How to transfer WP website, created with serverpilot, to a smaller droplet

September 16, 2016 112 views
WordPress Ubuntu 16.04

Previously, I needed a server for two websites, so I bought a larger droplet. I created both Wordpress sites using Serverpilot. Now I only need one website and I don't want to pay for a larger droplet. I have already deleted one of the sites, but now I'm not sure what is the best way to transfer the other. I still want to use Serverpilot afterwards.

1 Answer

Since you want to be able to manage your sites via serverpilot after the migration this will be slightly more complicated but still pretty straightforward.

You will first need to create your new smaller droplet and set it up in serverpilot installing an instance of WordPress.

Now you have two servers running WordPress. #1 is your old larger server which is currently hosting your site. #2 is your new smaller server which is showing a generic WordPress installation.

Now export your database using mysqldump on your old server. This will result in a .sql file. Download this and hold onto it.

Next, create an archive (using zip or tar) of your entire web root directory and download it as well.

Upload these files to your new server. On your new server.

connect to your mysql service and create a new database

create database newsite;

then exit the MySQL command line and run the following using your sql file.

mysql -uroot -p newsite < database.sql

Next, extract the archive you created of your web root so it replaces the current WordPress installation.

Edit the file wp-config.php so that the database name and username/password match your new server.

Ensure all web files are owned by the user the web service runs as:

chown -Rf www-data:www-data /var/www/html

where /var/www/html is the web root.

You should now have a working copy of your site on the new, smaller server.

by Etel Sverdlov
MySQL is a powerful database management system used for organizing and retrieving data. This tutorial explains how to import and export MySQL databases and how to reset a root MySQL password
Have another answer? Share your knowledge.