How to migrate an WordPress 4.8 site here at DO to a new 5.8 WP Site set up with MarketPlace 1-Click WP

I have on older droplet with Ubuntu 14 and WordPress 4.8. I just created a new WordPress droplet with the MarketPlace 1-Click Setup. Its a Ubuntu 20.04 and WordPress 5.8 droplet. During WP configuration script I used the same domain name information as my old site etc.

So now I need to know the best way to move the MySQL database and then the wp-content directory. Also, I am probably missing some steps.

Both droplets are in the SFO facility.

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
January 14, 2022
Accepted Answer

Hi @DanInSD,

At the moment you’ve created two different WordPress installations, one updated to 5.8 and one to 4.8. This means you’ll need to migrate your WordPress installation 4.8 to the new droplet and update WordPress there.

Another solution I can give you is to update your WordPress and Droplet rather than using a new one. You’ve mentioned you are using Ubuntu 14.04, it’s heavily out of date so you’ll need to update it as well.

I’ll try and provide steps for both, scenarios:

  • Updating your Droplet and WordPress
  • Migrating your WordPress to your new droplet.

Let’s start with the first option - Updating your Droplet and WordPress.

Before starting this option make sure to create a backup/snapshot as this process can be tricky and can result in some broken packages:

Now, once you do have a backup or a snapshot, SSH to your droplet and type in:

sudo apt update
sudo  apt upgrade
sudo do-release-upgrade

This will initiate the upgrade process, once it finishes you’ll have Ubuntu 18.04. You’ll need to reboot your Droplet and run the same 3 commands again to upgrade to 20.04.

Once this is finished you’ll just need to enter into your WordPress and upgrade it from the admin area

Next method - Migrating your WordPress to your new droplet.

Now, this one, you’ve already created a droplet with your new WordPress on it. What you can do is, dump your database from your old droplet and migrate it with your wp-content folder to your new droplet.

SSH to your droplet and go to the folder where your WordPress installation is located:

cd /path/to/website

In there grep for your MySQL’s credentials:

grep -i DB_ wp-config.php

Once you have them, you need to dump the database there:

mysqldump -u UserName -p DBName > mywordpressbackup.sql

This will dump the information from your database to a file. Now that you have this file, you can transfer it alongside the wp-content folder to your new droplet. You can use FTP for that or use SSH and rsync or scp, it’s up to you.

In case you want to use FTP, give the following docs a read:

Now, once you’ve transferred the data over, you’ll need to create a mysql database and username or use the one already created by your MarketPlace Droplet replace the wp-content folder with your old one and import the db over:

mysql -u UserHere -p DBHere < mywordpressbackup.sql

Hope this helps

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel