Question

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.

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:

https://docs.digitalocean.com/products/images/snapshots/

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:

https://docs.digitalocean.com/products/droplets/how-to/transfer-files/

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

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.