Report this

What is the reason for this report?

Redirecting inbound traffic to backup/snapshot droplet

Posted on July 26, 2021

I want to upgrade my droplet from Ubuntu 16.04 to 20.04. I know that the first steps are to create a snapshot and then create a new droplet from the snapshot.

To get inbound traffic to the backup droplet while the main droplet is updating, is it as simple as changing the A record for the domain to use the IP of the backup? Can I assume that the backup droplet will be fully functioning as soon as it’s created? Will changing the IP on the A record create significant downtime?



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.

Hello,

To avoid any downtime, what you could do is:

  • Create the backup Droplet from a snapshot
  • Before changing your A record make sure to fully test your website, you could do that by updating your local hosts file so that your PC would load the site from the secondary server rather than your main one.
  • Once you’ve fully tested the site, you could then point the A record of your domina name to the new Droplet’s IP
  • Then wait 12/24 hours to make sure that the DNS cache has cleared around the Globe
  • Finally you could proceed with the upgrade as you mentioned

One thing to keep in mind is the database, as if you are making some changes to your site, they would be preserved on the new Droplet, so you might have to carry them over to the old one once the upgrade has been completed.

Regards, Bobby

Heya,

Upgrading your droplet from Ubuntu 16.04 to 20.04 involves several steps, and ensuring minimal downtime requires careful planning. Here’s a detailed plan addressing your questions and guiding you through the process:

  1. Create a Snapshot:
  • Log into your DigitalOcean account.
  • Navigate to the droplet you want to upgrade.
  • Create a snapshot from the droplet’s menu. This serves as a backup.
  1. Create a New Droplet from the Snapshot:
  • Go to the “Create” button in the DigitalOcean dashboard and select “Droplet.”
  • Choose the “Snapshots” tab and select the snapshot you created.
  • Configure the new droplet settings (size, region, etc.) and create the droplet.
  1. Update DNS Records for Minimal Downtime:

Yes, changing the A record of your domain to point to the IP address of the backup droplet will direct inbound traffic to the backup.

  • Lower the TTL (Time to Live) of your DNS records to a minimal value (e.g., 60 seconds) a few hours before making the change. This ensures that DNS changes propagate quickly.

  • DNS changes usually propagate within the TTL period, but can sometimes take up to 24-48 hours globally. Lowering the TTL beforehand helps reduce this time significantly.

  1. Verify Backup Droplet Functionality:
  • Before making DNS changes, ensure the backup droplet is fully functional.
  • Test all services (web server, database, etc.) to ensure everything works as expected on the backup droplet.
  1. Perform the Upgrade on the Main Droplet:
  • Follow the official Ubuntu upgrade guide to upgrade from 16.04 to 20.04.
  • Update the Package List:

sudo apt update

  • Upgrade Installed Packages:

sudo apt upgrade sudo apt dist-upgrade

  • Install Update Manager:

sudo apt install update-manager-core

  • Begin the Upgrade Process:

sudo do-release-upgrade

  • Follow the on-screen instructions and prompts to complete the upgrade.
  1. Switch Back to the Main Droplet:
  • Once the upgrade is complete and you have verified the main droplet is functioning correctly, change the A record back to the IP of the main droplet.
  • Test to ensure traffic is routing correctly and all services are operational.

Ensure the backup droplet has all necessary configurations and data before switching DNS. This might involve syncing the latest data if there have been changes since the snapshot was taken.

If your application involves dynamic data (like a database), ensure data consistency between the main and backup droplet. You may need to sync data just before making the switch.

Use tools like dig or online services like DNS propagation checkers to monitor DNS changes.

Inform users about potential downtime or maintenance windows. Though the DNS switch is quick, some users might still experience brief interruptions.

Regards

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.