Database Migration Service in Google Cloud: Moving Databases With Minimal Downtime

Database Migration Service in Google Cloud: Moving Databases With Minimal Downtime

A deep, plain-English guide to Database Migration Service: how migration jobs work, how to prepare sources and destinations, how heterogeneous conversion works, and how to plan, validate and cut over with confidence.

Imagine moving a busy restaurant from an old building to a new one without ever closing its doors. You cannot simply carry everything out overnight, because customers keep ordering. Instead, you copy the pantry to the new kitchen while the old kitchen keeps cooking, you keep copying every new delivery as it arrives, and then, in one quick moment, you flip the sign and send customers to the new door. Database Migration Service is the crew that runs this move for your databases: copying the existing data, following every new change, and helping you switch over with only a short pause.

1What Database Migration Service Is and Why It Exists

Database Migration Service, often shortened to DMS, is a managed Google Cloud service for moving databases into Google Cloud’s managed database offerings.

Databases are the hardest part of any cloud move. Application servers are mostly replaceable, because you can start new copies from the same code. A database is different: it holds the accumulated memory of the business, it changes constantly, and it must never lose or corrupt a single record. Moving it with traditional tools usually means stopping the application, exporting everything, copying it, importing it, and starting again. For a large database, that downtime can last hours or days, which many businesses cannot accept.

DMS exists to shrink that downtime. It performs an initial copy of your data while the source database stays online, then continuously streams new changes to the destination until you are ready to switch. When you decide to cut over, the remaining gap is tiny. It also takes care of many chores that migrations normally require, such as setting up replication, monitoring progress, and, for some paths, converting the database’s structure and code from one engine to another.

Simple Analogy

Moving house with a single huge truck means the old house is empty for days. Moving with a shuttle service that keeps carrying things while you still live there, and then carries the last few boxes the moment you decide to leave, keeps you living normally until the very end. DMS is the shuttle service for databases.

What it is not

DMS is not a general-purpose data integration tool, and it is not a way to keep two databases synchronized forever. It is built for migration: a project with a beginning, a cutover moment, and an end. It targets Google Cloud’s managed relational databases, mainly Cloud SQL and AlloyDB. If you need ongoing replication into an analytics system, a different Google Cloud service is the right fit, and that comparison is covered later in this guide.

Managed
Google runs the migration machinery for you
Continuous
Follows source changes until you cut over
Short downtime
Only the final switch needs a pause
i
Good to Know

Supported sources, destinations and features expand over time. Treat any specific list in this guide as a snapshot of the idea, and confirm exact support in the current official documentation before you plan a project.

2Core Concepts You Must Know Cold

A small vocabulary explains every screen, message and decision in a migration project.

Each term below is defined by what it is, why it exists and where you meet it. Migration conversations move fast, and a shared vocabulary avoids expensive misunderstandings.

Term 1

Source database

The existing database you are leaving. It may live on-premises, in another cloud, or on a virtual machine.

Term 2

Destination database

The new managed database in Google Cloud that receives the data, such as a Cloud SQL or AlloyDB instance.

Term 3

Connection profile

A saved description of how to reach a source or destination: address, credentials, encryption settings and network details.

Term 4

Migration job

The configured unit of work that moves one source to one destination, with its own type, status and phases.

Term 5

Full dump

The initial bulk copy of existing data from source to destination.

Term 6

Change data capture

The ongoing process of reading each new change on the source and applying it to the destination. Often written as CDC.

Term 7

Promote

The cutover action that stops replication and turns the destination into a standalone, writable primary database.

Term 8

Conversion workspace

A working area used in migrations between different database engines, where schema and code are converted and reviewed.

Simple Analogy

A connection profile is a saved address book entry for a building. The migration job is the moving order that names the old building and the new one. The full dump is the first truckload, change data capture is the steady stream of new deliveries, and promote is handing over the keys.

Replication lag

Replication lag is the delay between a change happening on the source and appearing on the destination. During continuous migration, lag should hover near zero. It is the single most useful number for deciding when it is safe to cut over, because a cutover with high lag means recent changes would be missing.

!
Common Misconception

Many beginners think the migration is finished when the first copy completes. It is not. After the full dump, the job keeps streaming changes, and the project is finished only after you validate, promote and move applications over.

3Supported Paths: Homogeneous and Heterogeneous Migrations

Whether you keep the same database engine or change it shapes the entire project.

A homogeneous migration keeps the same database engine, for example moving a MySQL database to Cloud SQL for MySQL, or a PostgreSQL database to Cloud SQL for PostgreSQL or AlloyDB. The data model, the query language and the stored code all stay the same. These migrations are comparatively simple because the main work is copying and keeping data in sync.

A heterogeneous migration changes the engine, for example moving an Oracle database to PostgreSQL on Cloud SQL or AlloyDB. Here the tables, data types, indexes, stored procedures and application queries all speak a different dialect, so the project needs conversion in addition to copying. These migrations are larger, riskier and more valuable, because they let organizations leave expensive commercial licenses.

AspectHomogeneousHeterogeneous
EngineSame on both sidesDifferent on each side
Schema workCopied as isConverted and reviewed
Stored codeRuns unchangedMust be converted and tested
Application changesUsually small, mainly connection settingsOften significant, queries and drivers may change
Typical project lengthWeeksMonths
Main riskReplication prerequisites and cutover timingConversion gaps and behavioral differences

Commonly supported examples

Homogeneous

MySQL to Cloud SQL for MySQL

Uses the engine’s native replication to follow changes after the initial copy.

Homogeneous

PostgreSQL to Cloud SQL or AlloyDB

Uses logical replication to stream changes, with prerequisites on the source database.

Homogeneous

SQL Server to Cloud SQL for SQL Server

Commonly relies on backups and transaction log backups placed in Cloud Storage.

Heterogeneous

Oracle to PostgreSQL targets

Combines schema and code conversion with data copy and change capture. A very common modernization path.

flowchart TD
  S["Start: existing database"] --> Q{"Same engine on destination?"}
  Q -- Yes --> H["Homogeneous path"]
  H --> H1["Prepare source and connectivity"]
  H1 --> H2["Create and run migration job"]
  Q -- No --> X["Heterogeneous path"]
  X --> X1["Create conversion workspace"]
  X1 --> X2["Convert and review schema and code"]
  X2 --> X3["Apply converted schema to destination"]
  X3 --> H2
        
FIG 1 — The two paths and where they meet
!
Common Mistake

Assuming that a source and destination pair is supported because both products exist. Always check the current support matrix for your exact engines, versions and hosting platform before committing to a plan.

4Architecture and Components

DMS sits between your source and destination as a managed orchestrator and data mover.

You never install DMS on your servers. It is a Google-managed service that reaches out to your source database, reads data and change records, and writes them into the destination instance you prepared in Google Cloud. The service coordinates the stages, tracks progress, reports errors, and exposes controls such as start, stop and promote.

flowchart LR
  SRC["Source Database: on-premises or other cloud"] --> NET["Secure network path"]
  NET --> DMS["Database Migration Service"]
  DMS --> DST["Destination: Cloud SQL or AlloyDB"]
  CP1["Source connection profile"] -.configures.-> DMS
  CP2["Destination connection profile"] -.configures.-> DMS
  CW["Conversion workspace for heterogeneous jobs"] -.feeds schema.-> DST
  MON["Cloud Monitoring and Logging"] -.observes.-> DMS
        
FIG 2 — DMS between source and destination

The building blocks

Block

Connection profiles

Reusable descriptions of how to reach each database, including credentials and encryption.

Block

Migration jobs

The orchestrated process with its type, phases, status and settings.

Block

Destination instance

A managed database you create or let the service create, sized and configured for the new workload.

Block

Network connectivity

The private or protected path that lets DMS reach a source database.

Block

Conversion workspace

For different-engine migrations, where objects are translated and reviewed before applying.

Native tools under the hood

For homogeneous migrations, DMS generally builds on the database engines’ own proven replication and backup mechanisms instead of inventing a new one. This is a strength: it uses well understood technology and avoids exotic behavior. It is also why source prerequisites matter so much, because those mechanisms must be enabled and permitted on the source before DMS can use them.

Simple Analogy

A moving coordinator does not invent new trucks. They use standard vans, routes and rules, and handle scheduling and tracking. DMS coordinates standard database replication tools, and your job is to make sure the roads are open.

i
Practical Tip

Because DMS leans on native replication, a good first test is to confirm the source database is already configured for replication before touching any Google Cloud settings. Most early failures trace back to a missing prerequisite.

5How a Migration Job Runs: Dump, Change Capture and Promote

A continuous migration has three main phases, and understanding each one removes most of the mystery.

DMS supports one-time jobs and continuous jobs. A one-time job copies a snapshot of the data and then finishes, so the application must stop writing during the project to avoid losing changes. A continuous job copies the snapshot and then keeps applying changes until you promote, which is how you achieve minimal downtime. Most production migrations use continuous jobs.

sequenceDiagram
  participant App as Application
  participant Src as Source Database
  participant DMS as Database Migration Service
  participant Dst as Destination Database
  App->>Src: Normal reads and writes continue
  DMS->>Src: Start full dump
  Src-->>DMS: Existing data
  DMS->>Dst: Load existing data
  Note over DMS,Dst: Phase 1: Full dump
  Src-->>DMS: Stream of new changes
  DMS->>Dst: Apply changes continuously
  Note over DMS,Dst: Phase 2: Change data capture
  App->>Src: Writes stopped for cutover
  DMS->>Dst: Apply final changes, lag reaches zero
  DMS->>Dst: Promote destination to primary
  App->>Dst: Applications now use destination
        
FIG 3 — The life of a continuous migration job
1

Not started and testing

The job is defined but idle. You can run a test to check connectivity and prerequisites before any data moves, which catches many problems early.

2

Full dump in progress

The existing data is copied to the destination. The source stays online, and changes happening now are captured to be applied afterward.

3

Change data capture running

The destination catches up and then follows the source closely. Replication lag should settle near zero and stay there.

4

Ready to promote

You validate the data, stop writes on the source, wait for the last changes to arrive, and prepare to switch.

5

Promoted and complete

Replication stops and the destination becomes a normal writable database. Applications connect to it, and the source can be retired after a safety period.

Why the order matters

The service must capture changes from the moment the dump begins, otherwise changes made during the dump would be lost. It does this by recording a starting position in the source’s change log, copying the data as it existed at that position, and then replaying everything that happened afterward. This is why the source must retain its change logs long enough, and why running out of retained log space during a long dump can break a migration.

Simple Analogy

Photographing a busy whiteboard while people keep writing on it is tricky. The trick is to note the exact time of the photo, and then write down every edit made after that time. Combine the photo with the edit list and you have the up-to-date board. A full dump plus change capture is that photo plus edit list.

!
Common Mistake

Letting the source purge its change logs too soon. If the logs needed by the migration are deleted before they are read, the job fails and must restart from the beginning.

6Connectivity Options

Before any data moves, DMS must be able to reach your source safely.

Connectivity is where many migration projects stall. Your source database may sit behind firewalls, in a private data center, or in another cloud, and DMS must connect to it without exposing it unnecessarily. Several approaches exist, each with a different balance of simplicity, security and effort. The set of options and their names evolve, so verify the current list in the documentation.

MethodHow it worksBest whenConsideration
IP allowlistThe source accepts connections from DMS addresses over the internetQuick tests or sources already reachable publiclyExposes the database to the internet; use strong encryption
Reverse SSH tunnelA VM in Google Cloud and a tunnel create a protected path into the source networkSource cannot accept inbound connections from outsideNeeds a tunnel host and ongoing care
VPC peering or private connectivityA private path between your network and the serviceSources already reachable from a Google Cloud networkNeeds network planning and non-overlapping address ranges
VPN or dedicated interconnectA private link between your data center and Google CloudLarge, long migrations from on-premisesTakes time to provision but is the most robust option
flowchart LR
  OP["On-premises or other cloud database"] --> FW["Firewall"]
  FW --> VPN["VPN or Interconnect"]
  VPN --> VPC["Your Google Cloud VPC"]
  VPC --> DMS["Database Migration Service"]
  DMS --> DST["Cloud SQL or AlloyDB private address"]
        
FIG 4 — A private, durable path for large migrations

Bandwidth is a project constraint

Moving data takes time proportional to size and network speed. A one terabyte database over a modest link may take many hours, while tens of terabytes can take days or weeks. Calculate this early, using realistic sustained throughput rather than the advertised link speed. If the initial copy would take too long, consider a faster link, a temporary bandwidth upgrade, or an offline seeding approach where available.

Encryption in transit

Whatever method you use, enable encrypted connections between DMS and the source, because migration traffic carries every row of your data. Use certificates where supported and keep credentials in a controlled location.

Simple Analogy

A moving crew needs a clear road and an open gate. Leaving the gate wide open for everyone is risky, building a private tunnel takes work, and a dedicated driveway is the best long-term solution. Connectivity options are those same choices for your database.

i
Practical Tip

Run the job’s built-in test early. It validates connectivity and prerequisites without moving data, turning many surprises into cheap, quick fixes in the first week rather than the last.

7Preparing the Source Database

Most migration failures begin with a source that was not configured for replication.

Because DMS relies on the source’s own change records, the source must be configured to produce and keep them, and must grant a migration user the rights to read them. The exact settings depend on the engine and version, so follow the engine-specific checklist in the official documentation. The themes below describe what those checklists generally cover.

Theme 1

Change logging enabled

The source must record changes in a form that can be read, such as a binary log for MySQL, logical decoding settings for PostgreSQL, or log-based capture for other engines.

Theme 2

Sufficient log retention

Change logs must be kept long enough to cover the dump and any delays, so required changes are never purged early.

Theme 3

A dedicated migration user

Create a separate account with just the privileges needed to read data and replication information. Never use an administrator account for convenience.

Theme 4

Required extensions or components

Some engines need a replication extension installed, and a restart may be needed to apply certain settings.

Theme 5

Primary keys on tables

Replication usually needs a way to identify rows. Tables without primary keys may need special handling or may not replicate updates and deletes correctly.

Theme 6

Network and firewall access

The source must accept the chosen connection method, with ports open and encryption configured.

The restart problem

Some source settings, such as enabling change logs, require a database restart. A restart means a maintenance window on a production system, which needs scheduling, approvals and rehearsal. Discover this early in the planning phase, not on the day you intended to start the migration.

1

Review the engine checklist

Read the current prerequisites for your source engine and version, and note every setting that differs from your current configuration.

2

Plan changes and restarts

Group all required changes into one maintenance window where possible, and prepare rollback steps.

3

Create the migration user

Grant only the required privileges and store the credentials securely.

4

Open the network path

Configure firewalls, tunnels or private links, and confirm connectivity from the Google Cloud side.

5

Run the job test

Let DMS verify prerequisites, and fix every finding before starting the real job.

Simple Analogy

Before a moving crew arrives, the old house must have its doors unlocked, its boxes labeled and its driveway cleared. Source preparation is that same groundwork, and skipping it makes the moving day chaotic.

!
Common Mistake

Using a full administrator account for the migration because it avoids permission errors. This creates a serious security risk and hides which privileges are truly needed. Use a purpose-built account.

8Heterogeneous Migrations: Conversion Workspaces and Code Conversion

When the engine changes, the database’s structure and its code must be translated, not just copied.

Different database engines have different data types, different ways to express logic, and different built-in functions. An Oracle table column of one type may need a different type in PostgreSQL. A stored procedure written in Oracle’s procedural language must be rewritten in the destination’s language. DMS helps with this through conversion workspaces, which analyze the source, propose converted objects, and let you review and refine them before applying them to the destination.

flowchart TD
  A["Connect to source and read its schema"] --> B["Create conversion workspace"]
  B --> C["Automatic conversion of objects"]
  C --> D{"Everything converted cleanly?"}
  D -- Yes --> E["Review and apply to destination"]
  D -- No --> F["Fix unconverted items by hand or with assisted suggestions"]
  F --> G["Re-convert and re-check"]
  G --> D
  E --> H["Run data migration job"]
        
FIG 5 — The convert, review and apply loop

What gets converted

Object typeTypical conversion experience
Tables and columnsLargely automatic, with data type mapping that should be reviewed
Indexes and constraintsUsually automatic, though some special index types need rethinking
ViewsMostly automatic when the underlying SQL is standard
Stored procedures, functions and triggersPartially automatic, and the hardest part, needing human review and testing
Packages and vendor-specific featuresOften need redesign because the target has no direct equivalent
Application SQLLives outside the database and must be found, converted and tested separately

AI-assisted conversion

Google has added AI assistance to conversion workflows, which can suggest translations for code that rule-based conversion could not handle. Such suggestions speed up the work, but they are suggestions, not guarantees. Every converted routine must be reviewed by a person who understands the business logic and tested against realistic data. Treat the tool as a fast first draft, not a final answer.

Behavioral differences are the real risk

Even when code converts syntactically, engines can behave differently. They may treat empty strings and nulls differently, round numbers differently, order results differently without an explicit sort, handle dates and time zones differently, or lock rows differently under concurrent load. These differences produce bugs that tests with tiny data sets miss. Plan broad regression testing, including performance testing with production-sized data.

“Converting the syntax is the easy half. Preserving the behavior is the half that decides whether the migration succeeds.”
!
Common Mistake

Measuring conversion progress by the percentage of objects converted automatically. A high percentage can hide a small number of critical, complex routines that consume most of the remaining effort.

i
Practical Tip

Triage conversion results by business importance. Convert and test the routines behind your most critical transactions first, and consider retiring unused code instead of converting it.

9Planning and Assessment

The quality of a migration is decided long before the first byte moves.

A good plan starts with a clear inventory and a clear definition of success. Without them, teams drift into surprises such as an unsupported feature discovered a week before cutover. A thorough assessment answers a handful of questions about the source, the destination and the business constraints.

1

Inventory the databases

List every database, its engine and version, size, growth rate, owner and dependent applications. Include forgotten reporting databases and linked integrations.

2

Check compatibility

Compare source versions, extensions, features, collations and character sets against what the destination supports. Identify gaps early.

3

Define downtime tolerance

Agree with the business how long each application can be unavailable at cutover. This decides whether continuous migration is needed.

4

Choose the destination

Pick the destination product, edition, version, region and high availability level based on workload needs.

5

Plan the sequence

Order the migrations by risk and dependency. Start with a small, low-risk database to rehearse the process before touching critical ones.

6

Define success and rollback

Write down validation checks, performance targets and the exact conditions under which you would abort and return to the source.

Compatibility checks that often surprise teams

Check

Versions

Destination versions must be compatible with the source, and you usually cannot move to an older version.

Check

Extensions and plugins

Managed services allow only a supported list of extensions. An unsupported one may block the plan.

Check

Character sets and collations

Differences change sorting and comparison results and can cause subtle data issues.

Check

Privileges and administration

Managed services restrict superuser access. Features that require full administrative control may need rethinking.

Check

Linked servers and external dependencies

Cross-database links, scheduled agents and file-based jobs may not exist in the same form.

Simple Analogy

Before moving to a new apartment you measure the doorways and check that your sofa fits. Compatibility assessment is measuring the doorways for your database features, before the truck arrives.

i
Practical Tip

Rehearse the full migration on a copy of production data at least once. The rehearsal reveals real timings, real errors and real gaps, and gives your cutover plan credibility.

10Preparing and Sizing the Destination

The destination must be ready to receive the data and handle production load afterward.

DMS can create the destination instance as part of the job or use one you prepared. Either way, you decide its size, storage, region, network placement, version and settings. These choices affect both the speed of the migration and the experience of the application afterward.

Sizing for two different moments

The destination faces two different demands. During the initial load, it must absorb a huge volume of writes quickly. During normal operation after cutover, it must serve production queries with the right balance of cost and performance. A common approach is to size generously during the migration so the load completes faster and the destination keeps up with change streams, then resize down once the workload is understood. Whether and how resizing is possible depends on the product, so check the options.

Setting

Compute and memory

Enough capacity to apply changes without falling behind and to serve queries after cutover.

Setting

Storage size and type

Room for data and growth, with storage that matches your performance needs. Some storage cannot be shrunk later, so avoid wild overestimates.

Setting

High availability

Decide when to enable standby replicas. Some teams enable high availability only after the migration to speed up the initial load.

Setting

Database flags and parameters

Match important configuration settings from the source where applicable, and tune for the new engine.

Setting

Network placement

Use private addressing and place the instance in the region closest to your applications.

Setting

Encryption and backups

Choose encryption keys and a backup plan to be ready on day one after cutover.

Region choice and latency

Place the destination in the region closest to the applications that use it. If applications will run in a different region than the database, every query pays extra latency, which can make an otherwise successful migration feel slower to users. Plan the application move and the database move together.

Simple Analogy

A new warehouse must be big enough to receive the moving trucks quickly, and then efficient enough for daily operations. You may rent extra loading dock capacity for the move, then reduce it once the shelves are stocked.

!
Common Mistake

Choosing a tiny destination to save money during migration, then discovering the destination cannot apply changes fast enough, so replication lag keeps growing and cutover never becomes safe.

11Cutover Strategy and Rollback

The cutover is the short, tense moment that the whole project exists to make safe.

Cutover is the act of switching applications from the old database to the new one. With continuous migration, the preparatory work is done and the actual switch is brief, but it demands precision. Everyone involved should know their role, the order of steps, the checks to run and the conditions for aborting.

1

Confirm readiness

Check that replication lag is near zero, validation checks pass, and the destination is healthy. Confirm the team and the rollback plan are ready.

2

Stop writes on the source

Pause the applications or place the source in read-only mode so no new changes occur. This begins the downtime window.

3

Let replication drain

Wait until the final changes arrive and lag reaches zero. Verify that the last known transactions appear on the destination.

4

Promote the destination

Promote the job so the destination becomes an independent, writable database and replication ends.

5

Fix post-promotion details

Handle items that replication does not carry, such as sequence values, users and permissions, and engine-specific settings.

6

Repoint applications and verify

Switch connection settings, restart applications, and run smoke tests on key business transactions.

The rollback question

After promotion, the destination accepts new writes that the source never sees. If you must return to the source, those writes would be lost unless you have a plan. A DMS job does not automatically replicate backward, so teams that need a safe fallback set up their own reverse replication or accept a defined window during which rollback is possible only by losing or manually replaying recent changes. Decide this in advance, and define the point of no return.

Rollback approachHow it worksTrade-off
Fall back before promotionAbort the job and keep using the sourceSimple, no data loss, but only possible before the switch
Short validation window after promotionKeep the source read-only for a period, and revert if the destination fails early checksWrites made on the destination in that window need manual handling
Reverse replicationSet up replication from the destination back to the source after cutoverStrong safety net, but extra setup and engine-specific complexity
Simple Analogy

When you move out of an old house, you keep the keys for a few days in case you forgot something. Returning the keys is the point of no return. A cutover plan names that day in advance.

!
Common Mistake

Decommissioning the source database immediately after cutover. Keep it, read-only and backed up, for an agreed period so you can recover from surprises or compare data.

12Validation and Testing

A migration that finishes without errors is not necessarily a migration that is correct.

Validation answers three questions: is all the data there, is it identical, and does the application still behave and perform correctly? Each question needs its own checks, and automated checks scale better than manual spot checks.

Level 1

Structural checks

Compare the lists of tables, columns, indexes, constraints and routines between source and destination.

Level 2

Row counts

Compare the number of rows per table. A quick, cheap check that catches gross problems.

Level 3

Content checks

Compare checksums or aggregates of column values, or sample rows in detail, to detect subtle corruption or conversion errors.

Level 4

Application tests

Run the real application’s test suites and key business scenarios against the destination.

Level 5

Performance tests

Compare response times and throughput under realistic load, since the new engine may use different query plans.

Tools for comparison

Google provides an open source Data Validation Tool that can compare data between sources and destinations at scale, and many teams write their own scripted checks in addition. The best validation approach compares both counts and values, and runs more than once: during the replication phase for confidence, and again just before cutover and after promotion.

Moving data that changes while you validate

During continuous migration the source keeps changing, so a comparison at one moment can show small differences that vanish seconds later. Design validation to tolerate this, for example by comparing at a quiet moment, comparing data older than the replication lag, or running the final authoritative comparison after writes are stopped at cutover.

Simple Analogy

After moving, you count the boxes, check that the labels match the contents, and then test that the fridge actually cools. Counting, comparing and testing are three different checks, and a good move uses all three.

i
Practical Tip

Automate the validation suite and run it repeatedly during rehearsals. By cutover day the suite is trusted, fast and boring, which is exactly what you want.

13Performance and Large Databases

Big databases stress every part of a migration: the network, the source, the destination and your patience.

Migration speed is limited by the slowest of several things: how fast the source can read, how fast the network can carry data, and how fast the destination can write and build indexes. Finding and relieving the actual bottleneck is the key to meeting your timeline.

BottleneckSymptomTypical remedy
Network bandwidthThroughput flat at link speedIncrease bandwidth, use dedicated connectivity, schedule off-peak
Source read loadSource slows applications during the dumpRun dumps during quiet hours, use a read replica as the source where supported
Destination write capacityDestination CPU or disk saturatedScale up the destination during the load
Index and constraint buildsLong delay after data loadsPlan time for index creation, check how the service handles indexes during load
Change volume exceeds apply speedReplication lag keeps growingIncrease destination capacity, reduce source write bursts, investigate heavy tables
Very large single tablesOne table dominates the timelineCheck whether parallel loading is available, plan special handling

Protecting production during the dump

The initial dump reads a great deal of data from the source, which can slow the live application. Where supported, using a replica of the source as the migration source moves that load away from the primary. Otherwise, schedule the dump for a quiet period, and monitor source health during the process.

Handling write-heavy sources

On very write-heavy databases, change volume can be so high that the destination struggles to keep up, leaving lag that never reaches zero. In such cases, increase destination capacity, look for unusually heavy tables, and rehearse to learn the true steady-state behavior before the real cutover.

Simple Analogy

A moving chain has a loading crew, a truck and an unloading crew. The whole chain moves at the speed of its slowest link, so adding more loaders does nothing if the road is the limit. Find the slow link first.

!
Common Mistake

Starting the dump at the peak hour of the business day. The source slows down, users complain, and the team aborts the migration. Schedule heavy reading for quiet periods.

14SQL Server and Backup-Based Migrations

Some engines are migrated by restoring backups, which changes how the process feels.

For some engines, notably SQL Server, migration commonly works by restoring database backups on the destination and then applying a series of later backups to bring it up to date. Instead of streaming a live change feed, the source produces full, differential and transaction log backups, which are placed in Cloud Storage and applied in order by DMS. The destination stays in a restoring state until you promote it.

1

Take a full backup

Create a full backup of the source database and upload it to a Cloud Storage location the migration can read.

2

Restore on the destination

DMS restores the full backup to the destination, leaving it ready to accept later backups.

3

Keep shipping log backups

The source continues to produce differential and transaction log backups, which are uploaded and applied in sequence to reduce the gap.

4

Take the final log backup at cutover

After writes stop, take a last transaction log backup, apply it and promote the destination.

What this means for planning

Backup-based migrations depend on an unbroken chain of backups. A missing or out-of-order backup breaks the chain. The size and frequency of log backups determines how small the final gap is, so frequent log backups shorten downtime. Teams must also manage the storage location, permissions and the discipline of the backup schedule throughout the project.

Rule

Keep the chain unbroken

Never let another tool take backups that disrupt the log sequence, or the destination cannot continue.

Rule

Back up frequently near cutover

Smaller, more frequent log backups mean a shorter final catch-up and shorter downtime.

Rule

Secure the storage location

Backups contain all your data. Restrict access to the bucket and use encryption.

Simple Analogy

Rebuilding a book from its first edition plus a stack of numbered corrections only works if every correction is present and applied in order. A missing page number breaks the whole process, just like a missing backup in the chain.

!
Common Mistake

Running an independent backup job that truncates or breaks the log chain during the migration. Coordinate all backup activity on the source until cutover is complete.

15Security and Governance

A migration moves your most sensitive data, so security must be designed in from the start.

Control 1

Least-privilege IAM

Give the people running migrations only the roles they need, and separate those who configure jobs from those who approve cutovers.

Control 2

Encrypted connections

Use encrypted connections to both source and destination, with certificates where supported.

Control 3

Private networking

Prefer private paths such as VPN, interconnect or private addressing over public exposure.

Control 4

Encryption at rest and key management

Use the destination’s encryption features, including customer-managed keys where your policy requires them.

Control 5

Credential handling

Store migration credentials in a secret manager, rotate them after the project, and remove temporary accounts.

Control 6

Audit logging

Keep records of who created, started, changed and promoted jobs, for security review and compliance evidence.

Compliance during migration

Regulated data brings extra duties. Confirm that the destination region satisfies data residency requirements, that intermediate storage such as backup buckets is protected, and that the migration process itself, including temporary copies and logs, is included in your compliance scope. Document the controls so auditors can follow the story from start to finish.

Clean-up after the migration

Temporary resources become security debt if forgotten. After cutover and the safety period, remove migration users from the source and destination, delete tunnels and temporary VMs, close firewall openings, delete staging buckets and decommission the old database according to your data retention rules.

Simple Analogy

Movers get temporary keys, special parking passes and access to private rooms. When the move ends, you collect the keys and cancel the passes. Forgetting to do so leaves open doors long after the truck is gone.

i
Practical Tip

Put clean-up tasks on the migration checklist with named owners and due dates. A closure review that confirms each temporary access is removed turns good intentions into actual results.

16Monitoring and Troubleshooting

While a migration runs, a few signals tell you whether it is healthy.

DMS shows the status and phase of each job in the console and publishes metrics and logs to Google Cloud’s monitoring and logging services. Watching these signals, and setting alerts, lets you react quickly rather than discovering a stalled job hours later.

Signal

Job status and phase

Shows whether the job is dumping, replicating, paused, failed or ready to promote.

Signal

Replication lag

The key readiness metric. Rising lag signals the destination or network cannot keep up.

Signal

Throughput and data volume

Shows copy speed and helps forecast when the dump will complete.

Signal

Destination health

CPU, memory, disk and connections on the destination reveal capacity trouble.

Signal

Source health and log space

Source load and the remaining change log space affect both production and the migration.

Common failure themes

SymptomLikely causeDirection for the fix
Test or start fails on connectionFirewall, tunnel or credentialsVerify network path and profile settings from the Google Cloud side
Test fails on prerequisitesSource not configured for replicationApply the engine-specific settings and restart if required
Job fails during the dumpUnsupported object, permission gap or resource limitRead the error details in the logs and adjust the source or the object
Replication lag growsDestination too small or heavy write burstsScale up the destination and investigate heavy tables
Job fails after running a whileSource change logs purged or long network outageIncrease log retention and restore stable connectivity, then restart if needed
Data differences after promotionObjects not carried by replication, or conversion differencesCompare and repair, handle sequences, users and special objects explicitly

Alerting

Set alerts on job failure, on replication lag above a threshold for a sustained time, and on destination resource pressure. During a planned cutover window, share a live dashboard with everyone involved so decisions are based on the same facts.

Simple Analogy

A moving manager watches the truck’s progress, the road conditions and the unloading crew. If any of them slows, the manager reacts early. Job status, lag and resource health are the manager’s three views.

!
Common Mistake

Starting a job on Friday evening and not watching it. A stalled migration then wastes the weekend and may exhaust change log space. Set alerts and assign someone to monitor.

17The Cost Model

The migration service itself is only one part of the total cost of moving a database.

Pricing for DMS has varied by migration type, and Google has offered native, same-engine migrations at no additional charge for the service itself, while different-engine migrations have had separate pricing. Because this can change, confirm the current pricing page before budgeting. Regardless of the service fee, the migration project carries other real costs that often exceed it.

Service fee
Check current pricing by migration type
Destination
You pay for the new database from the day it exists
Double running
Source and destination both run during the project

Cost components to budget

Cost

Destination instance

Compute, storage, high availability and backups, often sized larger during the load.

Cost

Network and connectivity

VPN or interconnect, data transfer and any tunnel hosts.

Cost

Parallel running

The source keeps costing money until decommissioning, so a long project means paying for both.

Cost

Conversion and testing effort

For different-engine moves, people time dominates, and may far exceed all infrastructure costs.

Cost

Application changes

Engineering time to update drivers, queries and tests.

Cost

Staging storage

Backup buckets and temporary artifacts used during the migration.

The savings side

Migrations are justified by what happens afterward. Managed databases reduce operational work such as patching and backups, and moving from commercial licensed engines to open source engines can lower license costs significantly. Compare the one-time project cost with the ongoing savings over several years to judge the return, and include avoided hardware refresh costs in on-premises cases.

Simple Analogy

Moving to a new apartment costs the truck rental, but also an overlap month of rent for both places and time off work. The truck is rarely the biggest part of the bill.

i
Practical Tip

Shorten the overlap period with good planning and rehearsal. Every extra week of running both databases is a week of avoidable cost and risk.

18Design Patterns and Anti-Patterns

Experienced teams repeat a handful of habits, and avoid a handful of traps.

Patterns that work well

Pilot first, then scale

Migrate a small, low-risk database end to end before the critical ones. The pilot exposes process, permission and network problems cheaply and builds team confidence.

Rehearse with production-sized data

Run a full dress rehearsal on a recent copy of production, including cutover steps and validation, and use the measured timings to plan the real event.

Migrate in waves

Group databases and applications into waves by dependency and risk, so each wave is a manageable project with its own plan and review.

Separate data move from application move

Where possible, move the database first and keep applications connected across the network temporarily, then move applications later. This reduces the number of changes happening at once.

Decouple connection settings

Use configuration or a service name for database addresses, so cutover requires changing one setting instead of editing many applications.

Anti-patterns to avoid

ANTI-PATTERN-01 Avoid
Problem

The team attempts the first and only migration directly on the most critical production database.

Why It’s Harmful

Every unknown, from permissions to timings, is discovered under maximum pressure, and mistakes are costly.

Correct Approach

Begin with a pilot and a full rehearsal, and promote learnings into a repeatable runbook.

ANTI-PATTERN-02 Avoid
Problem

Cutover happens with no defined validation checks, no rollback plan and no named decision maker.

Why It’s Harmful

If something looks wrong, nobody knows whether to proceed or abort, and delays create longer downtime and riskier improvisation.

Correct Approach

Write a cutover runbook with timings, checks, owners, abort criteria and the point of no return.

ANTI-PATTERN-03 Avoid
Problem

The team treats a heterogeneous migration as a simple copy and underestimates conversion and testing work.

Why It’s Harmful

Stored code and application queries behave differently in the new engine, and late discovery of gaps blows up the schedule.

Correct Approach

Assess conversion complexity early, convert and test critical code first, and plan realistic effort for application changes.

ANTI-PATTERN-04 Avoid
Problem

Validation consists of checking that the job finished successfully and a few rows look right.

Why It’s Harmful

Subtle data differences, missing objects and performance regressions remain hidden until users find them.

Correct Approach

Automate multi-level validation covering structure, counts, content, application behavior and performance.

19Database Migration Service Compared with Other Approaches

DMS is one of several ways to move data, and each way fits a different goal.

ApproachWhat it doesBest forLimitation
Database Migration ServiceManaged migration with continuous change capture into Cloud SQL or AlloyDBLow-downtime moves into Google Cloud managed relational databasesLimited to supported engines and destinations; migration focused
Native dump and restore toolsExport with the engine’s tools and import on the destinationSmall databases where downtime is acceptableDowntime grows with size, manual and error-prone
Native replication set up manuallyConfigure the engine’s replication yourselfUnsupported combinations or special requirementsYou own all configuration, monitoring and troubleshooting
DatastreamServerless change data capture into destinations such as BigQuery and Cloud StorageOngoing replication for analytics and event pipelinesNot a database-to-database migration service
Third-party migration toolsCommercial replication and conversion productsUnusual sources, special transformations or existing vendor relationshipsExtra license cost and another tool to operate
Lift and shift of the whole VMMove the virtual machine hosting the database as isQuick moves of self-managed databases on virtual machinesYou keep managing the database yourself; no managed service benefits

How to choose

Start from the destination. If you want a managed Cloud SQL or AlloyDB database and your source is supported, DMS is usually the first thing to evaluate. If you want the data in an analytics warehouse, a change capture service is a better match. If you must keep running your own database software, moving the virtual machine may be simpler. If your downtime tolerance is generous and the database is small, a plain dump and restore may be enough and the least complex.

DMS Advantages

  • Managed service with no software to install
  • Continuous replication for minimal downtime
  • Built-in tests, monitoring and guided workflow
  • Conversion tooling for different-engine moves
  • Integrates with Cloud SQL and AlloyDB destinations

DMS Limitations

  • Supports specific engine and destination pairs only
  • Source prerequisites can require restarts and changes
  • Some objects and settings are not carried over
  • No automatic reverse replication for rollback
  • Conversion still needs human review and testing
Simple Analogy

Carrying a few boxes needs only your own car. Moving a whole household with minimal disruption justifies a professional moving service. Choose the service level that matches the size and urgency of the move.

20Best Practices and Common Mistakes

A short checklist separates calm migrations from stressful ones.

Best practices

Practice 1

Assess before you commit

Inventory databases and check versions, extensions and features against destination support.

Practice 2

Run the job test early

Validate connectivity and prerequisites long before the migration window.

Practice 3

Pilot and rehearse

Practice on a small database, then on production-sized data, with timings recorded.

Practice 4

Use private, encrypted connectivity

Avoid public exposure and protect migration traffic.

Practice 5

Size the destination for the job

Give it enough capacity to load and keep up with changes, and resize afterward.

Practice 6

Automate validation

Compare structure, counts and content repeatedly, not once.

Practice 7

Write a cutover runbook

Name steps, owners, checks, abort criteria and the point of no return.

Practice 8

Keep the source for a safety period

Retain it read-only and backed up until the new database is proven in production.

Common mistakes

!
Mistake 1

Discovering a required source restart on migration day. Check prerequisites early and schedule needed maintenance well in advance.

!
Mistake 2

Forgetting objects that replication does not carry, such as users, permissions, sequence positions and scheduled jobs. List them and handle them explicitly at cutover.

!
Mistake 3

Ignoring application changes. Connection strings, drivers, timeouts and error handling may need updates, especially across engines.

!
Mistake 4

Skipping performance testing. The same query can use a different plan on the new engine or version and become far slower under real load.

!
Mistake 5

Not communicating. Business teams, support staff and customers should know when the downtime window is, what to expect and whom to contact.

i
Habit Worth Building

Hold a short retrospective after each migration wave. Update the runbook with what went well and what failed, so the next wave starts from a better baseline.

21Real-World and Industry Scenarios

Concrete stories show how the ideas fit together in real projects.

Retailer leaving a data center

A retailer closing an on-premises data center must move dozens of MySQL and PostgreSQL databases. It connects its network to Google Cloud with a dedicated link, pilots with a low-risk internal database, then migrates customer-facing databases in waves, each with a rehearsal and a cutover in the overnight low-traffic window.

Leaving an expensive commercial database

A financial company wants to retire costly Oracle licenses. It creates conversion workspaces, converts schemas and stored procedures with careful review, rebuilds critical logic and tests extensively with production-sized data. The data migration runs continuously until cutover, and the business saves license costs for years afterward.

Moving from another cloud

A software company on another provider’s managed database wants to consolidate on Google Cloud. It uses private connectivity between clouds, runs continuous jobs, validates automatically, and cuts over each service independently with only a few minutes of read-only mode.

SQL Server estate modernization

A logistics firm moves several SQL Server databases to managed instances by shipping full and log backups to Cloud Storage. It coordinates backup schedules strictly to avoid breaking chains and takes a final log backup during a short planned maintenance window.

Self-managed PostgreSQL to a high-performance destination

A growing platform running PostgreSQL on virtual machines moves to a managed, high-performance PostgreSQL destination to reduce operations work. It rehearses twice, measures query performance carefully, and keeps the old database read-only for two weeks after cutover as a safety net.

Healthcare data with strict compliance

A healthcare provider migrates patient systems with private connectivity, customer-managed encryption keys, audit logging and a documented chain of approvals. Validation results are archived as evidence, and temporary migration access is revoked and recorded after completion.

i
Pattern to Notice

In every story, the successful teams invested in preparation, rehearsal and validation, and treated cutover as a rehearsed, boring event rather than a heroic one.

22Frequently Asked Questions

Short answers to the questions teams ask most when planning a migration.

Q1How much downtime should I expect?

With a continuous migration, downtime is usually limited to the cutover window: stopping writes, letting the last changes arrive, promoting, and repointing applications. That is often minutes, but the real figure depends on your size, change rate and rehearsed process. Backup-based and one-time migrations can involve longer windows.

Q2Does the source stay online during the migration?

Yes, in continuous migrations the source keeps serving the application during the dump and change capture. The dump does add read load, so plan it for quiet hours or use a replica as the source where supported.

Q3Can I migrate to a different database engine?

Yes, for supported combinations, such as certain commercial engines to PostgreSQL targets, using conversion workspaces. These projects need schema and code conversion plus thorough testing. Check current support for your exact engines and versions.

Q4What does promoting a job do?

Promote ends replication and turns the destination into an independent, writable database. After promotion, new writes go only to the destination, so do it after stopping writes on the source and confirming replication has caught up.

Q5Can I roll back after promotion?

Not automatically. The job does not replicate changes back to the source. Plan a rollback approach in advance, such as setting up reverse replication yourself or limiting the window in which rollback is possible, and decide the point of no return.

Q6Are users, permissions and sequences migrated?

Not always. Replication focuses on data and some structure. Database users, privileges, sequence values, scheduled jobs and certain engine-specific objects often need explicit handling. Check the current documentation for your engine and make a checklist.

Q7How do I know the data is correct?

Validate at several levels: structure, row counts, content comparison, application tests and performance tests. Tools such as Google’s open source Data Validation Tool can help automate comparisons.

Q8Why does my job fail the connectivity test?

Common causes are firewall rules, an incomplete tunnel or private link, wrong credentials, or missing encryption settings. Verify the network path from the Google Cloud side and re-run the test after each change.

Q9Is Database Migration Service the same as Datastream?

No. DMS is built to migrate databases into Cloud SQL and AlloyDB and finishes with a cutover. Datastream provides serverless change data capture for ongoing replication into destinations such as analytics warehouses and storage.

Q10What is the best first step for a migration project?

Inventory your databases and check compatibility with your chosen destination, then run a pilot with the job test on a small, low-risk database. Early discoveries are cheap and shape a realistic plan.

23Summary and Key Takeaways

Database Migration Service turns one of the riskiest parts of a cloud move into a guided, repeatable process. It copies existing data, follows ongoing changes, and lets you promote the destination with a short pause, while handling the machinery of replication and, for different engines, conversion. It moves databases into Google Cloud’s managed relational services and leaves you free to focus on planning, validation and the application changes around the database.

Success depends less on the tool and more on discipline. Assess compatibility early, prepare the source and connectivity, size the destination for the work, rehearse with real data, validate at multiple levels, and write a cutover runbook with a defined rollback stance. Teams that treat cutover as a rehearsed routine finish quickly and quietly. Teams that improvise on the final day learn expensive lessons.

Key Takeaways

  • Continuous migration minimizes downtime — a full dump followed by change data capture keeps the destination nearly current, so cutover is a short, controlled step.
  • Homogeneous and heterogeneous are different projects — same-engine moves mostly copy and sync, while different-engine moves add conversion, code review and behavior testing.
  • Prepare the source first — change logging, log retention, a dedicated migration user and network access cause most early failures, and some need restarts.
  • Connectivity and bandwidth shape the schedule — choose private, encrypted paths and calculate transfer time from realistic throughput.
  • Size and watch the destination — give it capacity to load and to keep replication lag near zero, and treat lag as the key readiness signal.
  • Validate in layers and rehearse — compare structure, counts, content, application behavior and performance, and run a full dress rehearsal on production-sized data.
  • Plan the cutover and the rollback — write a runbook with owners, checks and abort criteria, handle objects replication does not carry, and keep the source read-only for a safety period.