Skip to main content

How to Prevent Two Copies of a Database-Driven Website From Accepting Changes During Cutover

This article explains how to prevent data inconsistencies when migrating a database-driven website to Hostek. A customer can use these techniques to ensure that no new data (such as new orders, comments, or user registrations) is lost or split between...

Important: This procedure is critical for websites that use a database to store dynamic content. If not followed, a user might submit information on the old server while the new server is already live, causing that data to be "lost" on the new site.

Before you begin

You will need:

  • Access to the database of the website currently hosted with your previous provider.

  • Access to the database of the website hosted on your Hostek account.

  • The ability to put the old website into a "read-only" or "maintenance" state.

  • A planned maintenance window to perform the final synchronization.

Prepare for the cutover

To ensure a seamless transition, you must ensure that the website only accepts data on one server at a time.

  1. Identify the cutover window. Determine the specific time you plan to change your nameservers or DNS records to point to Hostek.

  2. Prepare a maintenance page. Create a simple "Maintenance" or "Under Construction" page.

  3. Put the old site into read-only mode. Before you change your DNS, place the old website into maintenance mode or disable its ability to write to the database.

  4. Perform a final data sync. Once the old site is in read-only mode, perform one final export and import of the database to the Hostek server to capture any remaining data.

Execute the cutover

Follow these steps to transition your traffic while protecting your data.

  1. Verify the new site is ready. Ensure the website on the Hostek server is fully functional and connected to the correct database.

  2. Set the old site to "Maintenance." Use your CMS (such as WordPress) or a server-level redirect to show a maintenance page on the old server.

  3. Update your DNS records. Change your nameservers or A records to point to the Hostek infrastructure.

  4. Monitor the DNS propagation. Wait for the DNS changes to propagate across the internet.

  5. Verify the new site is live. Confirm that visitors are being directed to the Hostek server.

  6. Remove the maintenance page. Once you are certain that the majority of traffic has moved to the Hostek server, remove the maintenance page from the new site.

Confirm the result

The transition is successful when:

  • The website is accessible on the Hostek server.

  • No new data is being submitted to the old server.

  • All recent data from the final sync is visible on the new site.

Limitations

This procedure does not automatically sync data that is submitted after the final sync but before the DNS has fully propagated. This is why the "read-only" or "maintenance" mode on the old server is a critical step to prevent data loss during the transition period.

Did this answer your question?