Moving a production database is one of the few IT projects where a mistake is visible to every customer within minutes. Orders stop saving, reports show yesterday's numbers, or an integration quietly writes to the old server for a week. The good news is that database migration is a well-understood discipline. With the right sequence, you can move to a managed cloud database with a cutover window measured in minutes and a tested way back if something goes wrong.
This checklist follows the phases our database and cloud transformation team uses on migrations: assess, convert, replicate, validate, cut over and stabilise. It applies whether you are moving a self-hosted MySQL server to a managed service or converting SQL Server to PostgreSQL along the way.
What 'without downtime' really means
There are three broad ways to move a live database, and they differ mainly in how long writes must stop. The right choice depends on database size, how much downtime the business can accept, and how much engineering effort you want to invest.
| Offline (dump and restore) | Online (full load + CDC) | Dual writes from the application | |
|---|---|---|---|
| Write downtime | Time to export, copy, import and verify | Usually minutes, for the final sync and switch | Close to none, if done well |
| Complexity | Low | Medium | High |
| Best for | Small databases, internal tools, generous maintenance windows | Most production systems | Systems that cannot pause writes at all |
| Main risk | Window overruns on large data | Replication gaps (sequences, large objects, missing keys) | Application bugs causing the two copies to drift |
For most business applications the online approach is the sweet spot: copy the bulk of the data while the source keeps running, stream every subsequent change to the target with change data capture (CDC), then pause writes briefly for the final switch.
- 01Assess
Inventory size, engine features, dependencies, performance baseline and compliance needs.
- 02Convert
Prepare the target schema, extensions, users and any application SQL changes.
- 03Load and replicate
Run the initial full load, then keep the target in sync with CDC.
- 04Validate
Compare counts, checksums and business totals; run tests and performance checks.
- 05Cut over
Pause writes, drain replication lag, switch connections and smoke test.
- 06Stabilise
Monitor, tune, verify backups and decommission the source on schedule.
Phase 1: Assess before you move anything
Most migration overruns trace back to something nobody wrote down at the start. Spend the first days building a precise picture of what you are moving.
- Size and growth: total data volume, the largest tables, daily change rate and peak write periods. These decide how long the initial load takes and how much replication must keep up with.
- Engine features in use: stored procedures, triggers, views, scheduled jobs, proprietary data types, full-text indexes and extensions. Each one needs a plan on the target.
- Every consumer: applications, BI tools, ETL jobs, cron scripts, partner integrations and admin consoles. Check the source's connection logs over at least a full business cycle, because a monthly report will not appear in a one-day sample.
- Performance baseline: your slowest and most frequent queries and their current latency, so you can prove the new environment is at least as fast.
- Compliance: data residency, encryption at rest and in transit, retention rules and who may access production data during the project.
Also decide early whether this is a homogeneous move (same engine, for example PostgreSQL to managed PostgreSQL) or a heterogeneous one (for example SQL Server to PostgreSQL). Engine changes add schema and code conversion work and are often part of a wider legacy database modernization. If several applications are moving at once, the portfolio view in our guide to the 7 Rs of cloud migration helps decide which ones to move first.
Phase 2: Schema conversion and application changes
For a homogeneous migration, this phase is mostly about version differences, extensions, collations, parameter settings, users and roles. For a heterogeneous migration it is the biggest chunk of work. Tools such as AWS Schema Conversion Tool or the open-source pgloader automate much of the table and data type mapping, but they rarely convert everything.
Expect manual work on stored procedures and triggers, date and time precision, boolean and identity columns, case sensitivity, default collations and SQL dialect differences in application code. An ORM hides many of these differences, but raw SQL in reports, admin screens and older modules usually needs attention. Review data access code alongside the schema, especially stored procedures and hand-written queries.
Phase 3: Initial load and continuous replication
CDC reads the source's transaction log (the binlog in MySQL, the write-ahead log in PostgreSQL, the transaction log in SQL Server) and replays each change on the target. You can use native logical replication, an open-source tool such as Debezium, or the managed migration services offered by the major cloud providers. Whichever you choose, check these points before starting:
- Log retention on the source is long enough to cover the full load plus a safety margin.
- Every table has a primary key; many CDC tools need one to apply updates and deletes correctly.
- Large objects (BLOBs, long text) are handled in the mode you expect, without silent truncation.
- Sequences and identity values are not always replicated; plan to reset them at cutover.
- Triggers and foreign keys on the target are disabled during load where needed, then re-enabled and verified.
- Replication lag is monitored and alerted on, not checked by hand once a day.
Phase 4: Validate the data, not just the row counts
Matching row counts prove very little. A date column shifted by a time zone or a truncated text field will pass a count check. Layer your validation:
- Row counts per table, as a quick first filter.
- Checksums or hashes of key columns, computed in chunks on both sides.
- Business reconciliations: invoice totals per month, active customers, stock on hand per warehouse. Ask finance and operations which numbers they would check first.
- Side-by-side comparison of sampled records, including edge cases such as nulls, special characters and very old rows.
- The application's automated tests and a performance run of the top queries against the target.
This is where a structured software testing and QA effort pays for itself: a scripted validation suite can be re-run after every rehearsal and again on cutover day.
Phase 5: Cutover and rollback plan
Rehearse the cutover at least once in a staging environment with production-like data, and time every step. The rehearsal turns cutover day into a checklist exercise rather than an improvisation.
- Rehearsal completed with recorded timings
- Replication lag close to zero and stable
- DNS or connection-string TTLs lowered in advance
- Go/no-go criteria and decision owner agreed
- Customers and internal teams notified of the window
- Put the application in maintenance or read-only mode
- Wait for replication lag to reach zero
- Run final checksums and business reconciliations
- Reset sequences and identity values
- Switch connection strings and run smoke tests
- Watch error rates and query latency closely
- Keep the source read-only, or replicate back to it
- Confirm backups and point-in-time recovery on the target
- Check source connection logs for stray clients
Adapt the order to your stack; the principle is to stop writes, drain, verify, switch, then watch.
DivTech SystemThe rollback plan needs the same care. Decide in advance which conditions trigger a rollback, how long you will wait before deciding, and who makes the call. The hard part is writes made after cutover: if you set up reverse replication from the new database back to the old one, you can fall back without losing them. Without it, rolling back means losing those writes or replaying them by hand, so the window in which rollback is realistic is short.
Phase 6: Stabilise and optimise
Once traffic is on the new database, tune parameters based on real load, confirm monitoring and alerting, and prove your backups by actually restoring one. After a few weeks of real metrics, right-size the instance; teams often over-provision for safety during migration and never scale back. Our guide to cloud cost optimization covers that step in more detail. Decommission the source only after the agreed period, and archive a final backup according to your retention policy.
How long does a database migration take?
It depends on data volume, whether the engine changes, the amount of logic in stored procedures and the number of dependent systems. As an indicative guide from DivTech projects, a same-engine move of a single application database often fits into a few weeks including rehearsal, while an engine change with heavy stored-procedure logic and many consumers can take several months. A short assessment gives you a much firmer estimate than any rule of thumb.
Planning your migration
If you are still choosing the target, our comparison of SQL vs NoSQL databases helps confirm the right engine, and if the migration is the first step towards analytics or AI, read about building an AI-ready data foundation. When you are ready to plan the move itself, request a quote and we will start with an assessment of your current database and its dependencies.
Frequently asked questions
Can a database migration really have zero downtime?
In practice the goal is a very short write pause, usually minutes, for the final sync and connection switch. Truly zero downtime is possible with dual writes or advanced replication, but it adds complexity that most businesses do not need.
What is change data capture (CDC)?
CDC reads the database transaction log and streams every insert, update and delete to another database. It lets the target stay in sync with the live source until you are ready to switch.
How do we know the migrated data is correct?
Combine row counts with checksums of key columns, business reconciliations such as monthly invoice totals, sampled record comparisons and the application's own tests run against the new database.
Should we change database engines during a cloud migration?
Only if there is a clear reason such as licence cost or end of support. Changing engines adds schema and code conversion work, so many teams move first on the same engine and modernise afterwards.