How to transfer database from old host to Digitalocean

Posted January 16, 2020 1.2k views


I am currently having a wordpress website at cloudways and I want to migrate to digitalocean. I successfully installed wordpress using easyengine (nginx) and I transferred wp-content to the new server here.

I am stuck at migrating the database. As I can understand the default location for databases is at /var/lib/mysql. How can I transfer my old database here using an .sql or file?

I used this command mysql -h localhost -u xtmdntvrds -p xtmdntvrds < xtmdntvrds.sql but when I insert password it gives me ERROR 1045 (28000): Access denied for user 'xtmdntvrds'@'localhost' (using password: YES)

The password is correct for sure because I can see it in wp-config.php file.

edited by MattIPv4

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.

Submit an Answer
1 answer

The simplest way is to install a Wordpress plugin called Duplicator and follow the instructions. It will also handle renaming of the URLs for you.

  • I tried using that but I have a lot of stuff to transfer so I can not use the free option.
    I have transferred everything except that database. I gained access in the new db, but I am stuck at importing the .sql file from the previous db.