- On the new server, install mysql server:
sudo apt-get install mysql-server mysql-client
- On the new server, stop the mysql server:
sudo service mysql stop
- On the new server, backup /var/lib/mysql:
sudo mv /var/lib/mysql /var/lib/mysql.bak
- On the old server, stop the mysql server:
sudo /etc/init.d/mysql stop
- On the new server, mirror /var/lib/mysql directory from the old server:
sudo rsync -avz root@old_server:/var/lib/mysql /var/lib/
- On the new server, run
sudo mysql_upgrade -u root -p
(NOTE: if you forget the root user password, you can reset the root password.)
- Start mysql server on the new server:
sudo service mysql start
No comments:
Post a Comment