Question

How to switch from Google Cloud to Digital Ocean

Posted September 24, 2019 3.3k views
DNSIPv6

I am migrating servers from Google Cloud engine to DigitalOcean. I’d like to ensure there’s zero-down time. I know I can update the DNS servers (but this will take some time). I would like to reroute any traffic coming to Google Cloud engine to my new DO server.

Any advice?

2 comments
  • Dear @mattiasf, I faced with the need to migrate virtual machines from Google Cloud to DigitalOcean. Could you please share your experience and migration instructions?

  • Hi @Dilmurat. There doesn’t seem to be a straight forward way, but what I would do is:

    1) Change DNS ttl (time-to-live) to lowest possible value, so when you perform migration, it happens faster.
    2) Move files manually using rsync.
    3) Create users / groups again from scratch.
    4) Verify your setup on new server
    5) Point DNS to your new server
    6) Allow remote access on your new database from your old server, and set old server to use new database. In case some visitors visit your site, and is directed to the old server, at least the new database is being used. This will prevent dataloss.

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.

×
2 answers

Hello, @mattiasf

You can migrate your sites over to DigitalOcean and test them using your hosts file on your PC and make sure everything is working fine before switching the DNS to DigitalOcean. In this way you can make sure everything is working properly on DigitalOcean and you will prevent any issues when switching the DNS. If you’re not familiar with the process let me know and I can provide you with detailed instructions in order to set your hosts file.

When you switch the DNS from Google Cloud to DigitalOcean there will be some propagation and some of the visitors may still “see” the version hosted on Google’s end. DNS changes might take up to 48 hours due to DNS cache from all the ISPs, but usually happens a lot faster.

Simply switching the DNS over should be completely fine. I don’t know if you’re running an eCommerce website or a simple blog, but even if someone places an order on your site or publish any comment/post and etc you can still re-migrate only the missing content/database table/row in order to make sure everything is updated on DigitalOcean end.

Another solution is that during the DNS propagation you can simply put a holding (coming soon/under maintenance page) for an hour or two in order to prevent any issues. This is something I’ve done before in order to make sure no one will visit the version on the old host during the DNS propagation.

If you have any questions, feel free to ask.

Hey! Thanks for your answer. The only real trouble I have is managing the SSL certificate through letsencrypt. Because while I am testing and DNS haven’t resolved yet, I don’t see it possible to make a letsencrypt certificate using the
certbot

  • Yes, that is correct. The cerbot will work once the DNS propagation is in place. From my previous experience, once you switch the DNS over you should be able to issue a new Let’s Encrypt SSL Certificate in the next hour or so.

    Let me know how it goes.

Submit an Answer