Easiest way to migrate domains from current droplet to new droplet

October 27, 2016 224 views
Miscellaneous Ubuntu 16.04

Before I mess anything up I wanted to know the easiest way to migrate existing domains and web sites to a new droplet. The current sites are static html hosted on a DO droplet and I would like to move them to a new droplet. I'm using Server Pilot as my control panel. Thanks!

1 Answer

With static sites it should be pretty easy.

1.) Download a copy of your site(s) if you do not have a local copy.
2.) Create a new droplet and configure apache or nginx (it may be possible to copy the configuration from /etc/apache2/sites-enabled or /etc/nginx/sites-enabled from the old server to the new)
3.) restart your web server (either service apache2 restart or service nginx restart)
4.) upload your files.
5.) You can now set up a hosts file entry locally to test your sites with their names before pointing your public DNS. On Windows this can be done in C:\Windows\system32\drivers\etc\hosts and on Mac or Linux it's in /etc/hosts. Create a new entry for each domain to test with your new droplet's IP address. This will override what comes from the DNS servers.
6.) Once everything works as expected, delete your host file entries and change the IP address in the A records on your DNS zone to point to the new droplet's IP address.

When done your sites will be served from the new server and you should not see any down-time. Let me know if I can provide more clarification on any of these steps.

Have another answer? Share your knowledge.