Last week I had a hard disk failure on my CentOS server. I managed to re-install CentOS on a new disk. I have the old mysql databases from /var/lib/mysql . Can I just move them to my new disk?
Any help or suggestions gratefully received.
MySQL is usually confined in /var/lib/mysql, so if you move the /etc/my.cnf and the /var/lib/mysql from the old server to the new one, you should be able to start the server normally, otherwise you should get some useful errors.
A typical error in such case is MySQL files ownership/permissions.
On Fri, Nov 15, 2013 at 2:18 PM, Timothy Murphy gayleard@eircom.net wrote:
Last week I had a hard disk failure on my CentOS server. I managed to re-install CentOS on a new disk. I have the old mysql databases from /var/lib/mysql . Can I just move them to my new disk?
Any help or suggestions gratefully received.
-- Timothy Murphy e-mail: gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin 2, Ireland
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Marios Zindilis wrote:
On Fri, Nov 15, 2013 at 2:18 PM, Timothy Murphy gayleard@eircom.net wrote:
Last week I had a hard disk failure on my CentOS server. I managed to re-install CentOS on a new disk. I have the old mysql databases from /var/lib/mysql . Can I just move them to my new disk?
Any help or suggestions gratefully received.
MySQL is usually confined in /var/lib/mysql, so if you move the /etc/my.cnf and the /var/lib/mysql from the old server to the new one, you should be able to start the server normally, otherwise you should get some useful errors.
A typical error in such case is MySQL files ownership/permissions.
Marios, please don't top post.
And speaking of ownership/permissions... watch out for selinux contexts. You may want to touch /.autorelabel and reboot, and walk away for a while....
mark
mark
On Fri, Nov 15, 2013 at 6:18 AM, Timothy Murphy gayleard@eircom.net wrote:
Last week I had a hard disk failure on my CentOS server. I managed to re-install CentOS on a new disk. I have the old mysql databases from /var/lib/mysql . Can I just move them to my new disk?
Any help or suggestions gratefully received.
What you are 'supposed' to do is take the backup that you make regularly with 'mysqldump' and restore it with the mysql command line program. But if you are running on the same cpu type and mysql version, moving the disk or copying the directory contents will work (along with the things already mentioned about /etc/my.cnf and selinux).
Am 15.11.2013 um 16:55 schrieb Les Mikesell lesmikesell@gmail.com:
On Fri, Nov 15, 2013 at 6:18 AM, Timothy Murphy gayleard@eircom.net wrote:
Last week I had a hard disk failure on my CentOS server. I managed to re-install CentOS on a new disk. I have the old mysql databases from /var/lib/mysql . Can I just move them to my new disk?
Any help or suggestions gratefully received.
What you are 'supposed' to do is take the backup that you make regularly with 'mysqldump' and restore it with the mysql command line program. But if you are running on the same cpu type and mysql version, moving the disk or copying the directory contents will work (along with the things already mentioned about /etc/my.cnf and selinux).
provided that the old system had shutdown the mysql process regularly. Means, the integrity of /var/lib/mysql is warranted.
-- LF