Question

How to migrate droplet

How to migrate linux server droplet with data backup and software and database sql


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.

alexdo
Site Moderator
Site Moderator badge
August 21, 2022

Hello @dprai-com

We have a series of tutorials on How To Migrate to a New Linux Server

https://www.digitalocean.com/community/tutorial_series/how-to-migrate-to-a-new-linux-server

As for the database, you can migrate it over to your DigitalOcean droplet using the mysqldump command.

To Export a database, open up a terminal, making sure that you are not logged into MySQL and type,

  1. mysqldump -u [username] -p [database name] > [database name].sql

The database that you selected in the command will now be exported to your droplet.

To import a database, first, create a new blank database in the MySQL shell to serve as a destination for your data.

  1. CREATE DATABASE newdatabase;

Then log out of the MySQL shell and type the following on the command line:

  1. mysql -u [username] -p newdatabase < [database name].sql

With that, your chosen database has been imported into your destination database in MySQL.

Additionally, if you’re interested in to DigitalOcean’s Managed Database you can use the online import tool to quickly migrate your database.

https://www.digitalocean.com/blog/migrate-your-database-to-digitalocean-managed-databases

Online migration allows you to transfer data from a database that’s either hosted on DigitalOcean (e.g. database running on a Droplet) or someplace else (e.g. an on-premises database or database in other cloud providers).

Regards

KFSys
Site Moderator
Site Moderator badge
August 20, 2022

Hi @dprai-com,

When talking about migrations, before you start migrating your websites you’ll need to configure everything else.

We have a series of tutorials that cover the process of migrating from one Linux server to another which you can check here:

https://www.digitalocean.com/community/tutorial_series/how-to-migrate-to-a-new-linux-server

In general, depending on your site/application you will need to spin up a droplet that matches your current hosting provider environment or at least is suitable for your app/site needs (e.g running the same PHP version). Then you need to migrate your data (files, users, database and etc).

Additionally, if you are using WordPress as a CMS, you can use the WP All in One plugin or Duplicator to migrate all of your WordPress websites.

https://wordpress.org/plugins/all-in-one-wp-migration/

https://wordpress.org/plugins/duplicator/

If you have to move some of the data manually you can do that via ssh using scp or rsync. Another option is to use an FTP client like FileZilla

https://www.digitalocean.com/community/tutorials/how-to-copy-files-with-rsync-over-ssh

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

Try DigitalOcean for free

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

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

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

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
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
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.