By strebla
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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.