Report this

What is the reason for this report?

How to import database in MySQL from Windows machine to my DO droplet

Posted on March 21, 2019

Hi,

I have a Joomla website which I need to migrate from shared hosting to DO droplet having CentOS 7 installed on it.

I have already taken the whole website backup including the database on my Windows 7 machine.

I have tried to create the necessary environment by installing Apache, MySQL, PHP.

I have also created an empty database and the username having the same name as that in the configuration.php file.

Now, before i move Joomla files to a new location, I need to have the newly created empty database replaced/restored/populated with the old(backed-up) database.

So, how do I migrate and restore that database to DO droplet?

I am using Putty as an SSH client to connect to my DO server.



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!

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.

Greetings!

You can upload the backup file for the database and import it over command line. On Windows, perhaps SFTP using FileZilla would be the easiest way:

https://www.digitalocean.com/community/tutorials/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps

Now let’s say you’ve ended up with a file named “backup.sql” in /root, and you want to import it to your new database which I’ll assume is named “joomla.” In that case, over SSH I would run this:

mysql joomla < /root/backup.sql

Then you’re done :)

Jarland

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.