How can I move in to DO a wordpress from an other VPS

May 28, 2015 670 views

Hi there,
Im wondering how can I move in a wordpress website which is running at the moment at an other VPS in to DO ? Anyone who has done this and can share a short (or long) tutorial/guide?

1 Answer

The following procedure should do the trick for you.

1.) Create a zip or tarball of your public web directory on your current VPS.
2.) Use mysqldump to create a backup of your wordpress database

mysqldump -uusername -p dbname > mydb.sql

3.) Create a new droplet using the LAMP image, this will be easier to use when importing a new site since we won't have to delete an existing database or overwrite files.
4.) Get your new MySQL root password from the MOTD displayed when you log into your new droplet via ssh.
5.) Use scp or SFTP to transfer your web directory files to your droplet and extract them to /var/www/html
6.) Use the mysql command line tool to create a new database and then import your database backup.

mysql -uroot -p
create database wordpress;
mysql -uroot -p wordpress < mydb.sql

7.) Check your wp-config.php in your web root and update the database details to match those for your new droplet.

Have another answer? Share your knowledge.