I need help migrating my wordpress server

Some time back, I set up my wordpress server on an Ubuntu 19.10 droplet. Since support for 19.10 has been dropped, I need to migrate my installation to a new VPS. I have created a new droplet, installed wordpress on it, and backed up the database on the old VPS.

My challenges are as follows:

  1. How do I transfer my wp files over to the new server. I have read up about rsync, and scp, however, I am stuck when it comes to authenticating between the two servers. I currently use one SSH key to remote into both these servers. Is it possible to have multiple SSH keys and how do I generate them.
  2. Do I restore the database after the file transfer or before?

I am very new to all this, and had set up my wordpress website a long time back. I am however limited now as I cannot improve the functionality of my website without upgrading my server.

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.

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.

Hi @ak331,

Okay, so let’s start with your First problem, connecting between two Droplets. What you can do in this situation is generate an SSH key on the droplet you are migrating FROM and add the SSH key to the droplet you are migrating TO.

So, to do that, go to your old Droplet, the Ubuntu 19.10, SSH to it and type in:

ssh-keygen -t ed25519

Hit enter on all asked questions. Once you do, you’ll have an SSH key generated in the home directory of your user, if you executed the above command using root, you’ll have an SSH key in


Now, copy the file, it’s in the .ssh folder. You need to paste it on your New Droplet, inside /root/.ssh/authorized_hosts. If such a file doesn’t exist, create it. Once you paster the line, try to SSH you should be able to connect between the OLD and the New Droplet.

As for the second question,

After you’ve transferred the files, you can dump the database into a file from your old Droplet, rsync it to the new Droplet and import the database there.

When you are ready with migrating the files, type the following on your Old droplet to dump the database:

mysqldump NameOfDatabase > nameofdatabase.sql

This will dump the information of your database to the .SQL file. Now Rsync the file to the new Droplet. Once you do, you’ll need to import the .SQL file to a database you’ve created on the New Droplet. Before importing the database, create a database user which has privileges for the newly created database on your new Droplet.

Once you have this information, import the database like so:

mysql NameOfDatabase < nameofdatabase.sql

and that’s it.

Hope this helps a bit.