Google Cloud Database Migration Service: Move Your Data Without Stopping the Business
A beginner-friendly, book-style guide to Database Migration Service, the serverless Google Cloud tool that copies your database to the cloud, keeps it in sync while your application keeps running, and lets you switch over with minimal downtime.
Imagine you run a busy restaurant and you are moving to a bigger building across town. You cannot close for a month to carry every pot and plate. So you copy the kitchen to the new place in the background, keep both kitchens stocked identically while you still serve guests in the old one, and then, on a quiet evening, you lock the old door and open the new one. Database Migration Service does exactly this for databases.
This guide assumes you know nothing about database migration. Every new word is explained the first time it appears, with a simple comparison from daily life. By the end you will understand what the service is, how it works inside, the difference between its migration types, how to connect safely, how to plan and carry out a cutover, what can go wrong, and when to use a different tool.
1What Is Database Migration Service and Why Does It Exist?
A managed way to move databases into Google Cloud while the old one keeps working.
The problem with moving a database
A database holds the memory of a business: customers, orders, payments, messages. Moving it is harder than moving files, because the data changes all the time. If you copy it on Monday and switch on Tuesday, everything that happened in between is missing. The simple fix is to stop the application, copy everything and restart on the new database. For a small database this takes minutes. For a large one it can take many hours or days, and a shop that is closed for days loses money and customers.
What the service does about it
Database Migration Service, often called DMS, is a serverless service that migrates databases into Cloud SQL and AlloyDB for PostgreSQL on Google Cloud. It takes a first full copy of your data, then keeps copying every change that happens afterwards, so the new database stays almost identical to the old one. When you are ready, you switch your application to the new database after only a short pause. DMS also streamlines networking, tracks progress and reports the state of the migration throughout.
Think of moving a river into a new channel. You dig the new channel first while water still flows in the old one, then open the gate at the top so the water fills the new path and the old one runs dry. People downstream hardly notice.
DMS moves databases into Google Cloud. It is not a general tool for moving data between any two systems, and it is not meant for copying data from Google Cloud out to other places. Keep that boundary in mind when choosing it.
2Core Concepts in Plain English
Ten words that appear in every migration discussion.
Source database
The database you are moving away from. It can be in your own data center, on another cloud, or on a virtual machine.
Destination database
The Cloud SQL or AlloyDB database you are moving to. It is created and managed by Google Cloud.
Migration job
The main DMS object. It ties a source and a destination together and controls the copy from start to finish.
Connection profile
A saved description of how to reach a database, including its address, port and the migration user account.
Initial snapshot
The first full copy of the data, taken at one moment in time.
Change Data Capture
Often shortened to CDC. A technique that notices only the inserts, updates and deletes after the snapshot and copies just those changes.
Replication lag
The delay between a change on the source and its appearance on the destination. Near zero lag means the two are in step.
Promote and cutover
Promoting stops replication and turns the destination into a normal standalone database. The cutover is the whole switch of your application to it.
Conversion workspace
A workspace used in heterogeneous migrations to convert the structure and code of one database technology into another.
Downtime
The period when your application cannot use the database normally. The goal is to make it as short as possible.
Do not worry about memorizing these. Each is explained again with examples in the chapters ahead.
3Homogeneous and Heterogeneous Migrations
The first big question: are you keeping the same database technology or changing it?
Homogeneous: same technology
A homogeneous migration moves data between the same kind of database. For example, from MySQL running in your data center to Cloud SQL for MySQL, or from PostgreSQL to Cloud SQL for PostgreSQL. The structure of tables, the data types and the code stored in the database all carry over without translation, so these migrations are simpler, faster and less risky.
Heterogeneous: different technology
A heterogeneous migration moves data between different database technologies. The classic example is Oracle to PostgreSQL. The two systems describe tables and data types differently, and the code stored inside the database, such as procedures and functions, is written in different languages. DMS handles this with conversion workspaces that translate the structure and objects into a form the destination understands. Current supported heterogeneous paths include Oracle to Cloud SQL for PostgreSQL and AlloyDB for PostgreSQL, and SQL Server to Cloud SQL for PostgreSQL and AlloyDB for PostgreSQL.
Moving a book from one shelf to another is homogeneous. Translating the book from French to English before shelving it is heterogeneous. The second job needs a translator, takes longer, and must be proofread.
| Feature | Homogeneous | Heterogeneous |
|---|---|---|
| Source and destination engine | Same technology | Different technologies |
| Typical example | MySQL to Cloud SQL for MySQL | Oracle to Cloud SQL for PostgreSQL |
| Schema conversion | Not needed | Required, using a conversion workspace |
| Application changes | Usually none | Often needed, especially for stored code and queries |
| Complexity and risk | Lower | Higher |
| Typical effort | Days to weeks | Weeks to months |
Treating a heterogeneous migration as a data copy job. The data movement is the easy part. Converting stored code, tuning queries and testing the application take most of the time.
4One-Time and Continuous Migrations
The second big question: can you afford to stop writing to the database while it is copied?
One-time migration
A one-time migration takes a single snapshot of the source and loads it into the destination. This is a classic dump and load. The destination is ready as soon as the load finishes. The catch is that any changes made to the source after the snapshot are not copied, so the application must not write to the source during the migration. This is acceptable for small databases, development systems, or workloads that can tolerate a maintenance window.
Continuous migration
A continuous migration, sometimes called ongoing or online migration, starts with an initial full snapshot and then keeps streaming changes using Change Data Capture. The source stays fully in use while data flows to the destination. When both are in sync, you promote the destination and switch. This approach minimizes downtime because it replicates only modifications instead of repeatedly copying everything, the data migrates while the source remains operational, and the serverless design performs well at scale.
flowchart LR
SRC["Source Database"] -->|"1. Initial snapshot"| DST["Destination Database"]
SRC -->|"2. Ongoing changes via CDC"| DST
APP["Application keeps working"] --> SRC
DST --> PR["3. Promote and switch application"]
| Question | One-time | Continuous |
|---|---|---|
| How is data copied? | One snapshot | Snapshot, then ongoing changes |
| Can the source keep taking writes? | No, not without losing them | Yes |
| Expected downtime | Length of the copy | Short pause at cutover |
| Best for | Small or non-critical databases | Production systems that must stay available |
| Source preparation | Less | More, since change logging must be enabled |
A one-time migration is photocopying a notebook once. A continuous migration is photocopying it, then having an assistant copy each new line you write, as you write it, until the day you pick up the copy and leave.
5Architecture and Components
The small set of objects that you create and the work Google does behind the scenes.
DMS has very few moving parts from your point of view. You describe the source, you describe the destination, and you create a job that connects them. Google runs the machinery that reads, transfers and applies the data. Because the service is serverless, you do not install or size any migration servers.
flowchart TD
CPS["Source Connection Profile"] --> MJ["Migration Job"]
CPD["Destination Connection Profile"] --> MJ
CW["Conversion Workspace (heterogeneous only)"] --> MJ
NET["Connectivity Method"] --> MJ
MJ --> SNAP["Snapshot and Load"]
MJ --> CDC["Continuous Replication"]
SNAP --> DEST["Cloud SQL or AlloyDB"]
CDC --> DEST
MJ --> OBS["Status and Metrics"]
Connection profile
Holds the name, address, port and migration user credentials for one database. You make one for the source and one for the destination.
Migration job
Chooses the type, links the profiles, selects the connectivity method and drives the process.
Conversion workspace
Where schema and code conversion happens in heterogeneous migrations, with an interactive editor to fix issues.
Private connection
A private network path used for some connectivity setups, so traffic avoids the public internet.
A fully regional service
DMS is regional. All entities in one migration, including both connection profiles, the migration job, the destination database and any conversion workspace, must live in the same region. Choose that region early, because it affects speed, network design and where your data will sit after the move.
Pick the region closest to your users and to the rest of your cloud applications, and check that the destination service is offered there before you build anything else.
6Supported Sources and Destinations
What you can move from, and what you can move to.
Sources include MySQL, PostgreSQL, SQL Server and Oracle databases, whether they run in your data center, on virtual machines, or on other cloud providers’ managed database services. Destinations are Cloud SQL for MySQL, PostgreSQL and SQL Server, and AlloyDB for PostgreSQL. Which exact pairs are allowed depends on the migration style and on versions, so always check the current compatibility tables before planning.
| Source | Destination | Style |
|---|---|---|
| MySQL | Cloud SQL for MySQL | Homogeneous |
| PostgreSQL | Cloud SQL for PostgreSQL or AlloyDB for PostgreSQL | Homogeneous |
| SQL Server | Cloud SQL for SQL Server | Homogeneous |
| Oracle | Cloud SQL for PostgreSQL or AlloyDB for PostgreSQL | Heterogeneous |
| SQL Server | Cloud SQL for PostgreSQL or AlloyDB for PostgreSQL | Heterogeneous |
From your own data center
The most common case: a company moving older on-premises databases to managed cloud databases and closing a server room.
From another cloud
A team consolidates onto Google Cloud and moves databases from another provider’s managed service.
From virtual machines
A database that was installed by hand on a Compute Engine virtual machine is moved to a managed service to avoid running it manually.
A source version that is very old or very new may not be supported. Confirm engine versions, editions and special features such as certain extensions before you commit to a schedule.
7Internal Working: Snapshot, Change Capture and Apply
What actually happens between pressing Start and reaching the finish line.
Connect and verify
DMS checks that it can reach the source with the migration user, that required settings are enabled, and that the destination is ready.
Full dump of existing data
The service takes an initial snapshot that captures the current state of the data at a single point in time.
Load into the destination
The snapshot is loaded into the destination database. For heterogeneous migrations, the converted schema is applied first.
Start continuous replication
From the moment the snapshot was taken, every change on the source is read from its change log and applied to the destination in order.
Catch up and stay in step
The destination works through any backlog until lag is very small, then stays close behind the source.
Promote at cutover
When you are ready, replication is finalized and the destination becomes a standalone primary that applications can read and write.
sequenceDiagram
participant S as Source Database
participant D as DMS Service
participant T as Destination Database
D->>S: Connect with migration user
D->>S: Take initial snapshot
S-->>D: Existing data
D->>T: Load snapshot
S-->>D: Stream of changes from change log
D->>T: Apply changes in order
Note over S,T: Lag shrinks toward zero
D->>T: Promote on request
Why the change log is the hero
Every serious database already writes each change to a log so it can recover after a crash. CDC reads that same log. This is why continuous migration needs the source to keep its change log turned on in the right format, and why it causes little extra load on the source compared with repeatedly querying all the tables.
A cashier writes every sale on a paper roll. The assistant at the new shop reads that roll line by line and enters the same sales into a second ledger. The roll already existed, so the cashier does no extra work.
8Connectivity and Networking
The bridge between your source and Google Cloud has to be safe and fast enough.
DMS must be able to reach the source database, and the destination must be reachable too. Several connectivity methods exist, and the right one depends on where the source lives and what your security rules allow. Source and destination can use different methods.
IP allowlist
The source firewall allows the public addresses used by DMS. Simple to set up, but it exposes the source to the internet, so encryption is essential.
Reverse SSH tunnel
A tunnel opened from a helper machine near the source outward to Google Cloud. Useful when you cannot open inbound firewall rules.
VPC peering
Connects your Google Cloud virtual network directly to the network that DMS uses, keeping traffic private when the source is reachable from that network.
Private connectivity through VPN or Interconnect
A VPN tunnel or a dedicated line joins your data center to Google Cloud. The migration then travels over a private route with predictable speed.
flowchart LR
OP["On-premises or Other Cloud Source"] -->|"VPN or Interconnect"| VPC["Google Cloud VPC"]
VPC --> DMS["Database Migration Service"]
DMS --> DEST["Cloud SQL or AlloyDB"]
OP -.->|"Allowlist over public internet"| DMS
Bandwidth and distance
The speed of the initial copy is limited by the network between source and destination. A database of several terabytes over a slow link can take a very long time. Estimate the transfer time by dividing data size by realistic sustained speed, not by the advertised line speed, and leave room for other traffic sharing the link.
Leaving address allowlists wide open after the migration ends. Remove temporary firewall rules, tunnels and test accounts as soon as the job is finished.
9Preparing the Source and Destination
Most migration problems are solved, or caused, before the job ever starts.
Preparing the source
Continuous migration needs the source to record changes in a way DMS can read. Each engine has its own settings, such as turning on binary logging for MySQL or enabling logical decoding for PostgreSQL. You also create a dedicated migration user with only the permissions DMS requires, rather than reusing an administrator account. Check that the source has enough free disk space to keep change logs while the snapshot is being copied, because logs are held until DMS has read them.
Preparing the destination
The destination Cloud SQL or AlloyDB instance must be created or provisioned with enough size for the data, the expected growth and the extra load during the initial load. Choose the engine version, region, storage and networking carefully. For production systems, plan high availability, backup settings and maintenance windows early, even if you turn some of them on only after cutover.
Preparing the people
Decide who owns the migration, who approves the cutover, who tests the application and who talks to the business. A clear owner for each step prevents the silence that causes late night confusion.
Inventory the databases
List every database, its size, version, features used, owners and the applications that depend on it.
Check compatibility
Compare versions and special features against what the destination supports. Note anything that will need change.
Configure the source
Enable change logging, create the migration user and open the chosen network path.
Create the destination
Provision the instance with the right size, region and security settings.
Run a rehearsal
Do a full practice migration of a copy, test the application against it, and measure timing.
A rehearsal is the best insurance you can buy. It reveals missing permissions, network surprises and real copy times while mistakes are still harmless.
10Schema and Code Conversion for Heterogeneous Migrations
Teaching one database to speak the language of another.
When the source and destination technologies differ, the structure of the database, called the schema, and the code inside it must be translated. DMS provides conversion workspaces for this. When you create a workspace, an initial conversion happens automatically. Then an interactive SQL editor helps you review the result, fix issues and adjust the design to suit the destination. Gemini assisted conversion can help translate code objects such as stored procedures, functions and triggers, but its output must always be reviewed by people who understand the application.
Import the source structure
DMS reads the tables, views, indexes, procedures and other objects into the workspace.
Automatic conversion
The service converts what it can, and marks objects that need human attention.
Review and fix
Developers inspect warnings, edit converted code and apply mapping rules, for example for how data types should be translated.
Apply to the destination
The approved structure is created in the destination database before data is loaded.
Test the application
Run real queries, reports and batch jobs against the converted database and compare the results.
A translator turns a French contract into English. A clever tool produces a first draft quickly, but a lawyer must still read it, because one wrong word can change the meaning of a whole clause.
Trusting automatic conversion without testing. Subtle differences in how engines handle dates, text comparison, empty values and number rounding can quietly change application results.
Application changes
Besides the database code, the application’s own queries and connection settings may need changes. Plan developer time for this and include it in the schedule. It is often the largest part of a heterogeneous project.
11Monitoring a Running Migration
Watch lag, status and errors so you know when it is safe to switch.
While a migration job runs, DMS shows its status and observability charts for items such as replication delay and storage usage, and many scenarios let you filter them per database. The most important signal is replication lag. If lag stays small and steady, the destination is keeping up. If it keeps growing, the destination, the network or the source is struggling.
Full dump in progress
The initial snapshot is being copied and loaded. Duration depends on data size and network speed.
CDC in progress
Changes are being replicated. Watch lag to see how close the destination is.
Ready to promote
Replication is caught up and the job can be promoted when you choose.
Failed or paused
Something blocked the job, such as lost connectivity or a permissions problem. Read the error, fix it and restart.
Common causes of growing lag
A destination instance that is too small, a slow or congested network, very large transactions on the source, bursts of heavy writes, or a lack of indexes on destination tables can all cause lag to build. Address the cause rather than only waiting, because lag directly lengthens your downtime at cutover.
Set alerts for lag, for job failures and for disk space on both sides. A migration that runs for days needs an alarm clock, not someone staring at a screen.
12Validation, Testing and Cutover
The moment of truth: proving the copy is right, then switching.
Validate before you switch
Check that the destination matches the source. Compare row counts for key tables, compare totals or checksums for important numbers such as account balances, and run sample queries on both sides. Run the application’s automated tests against the destination, and let a few real users or testers try typical tasks. Review the performance of the heaviest queries, because the destination may behave differently even when the data is identical.
The cutover steps
Cutover is the controlled switch of the application from the source to the destination. A typical sequence starts with a announcement and a quiet moment. The application is placed in read-only mode or stopped, so no new writes reach the source. You wait for replication lag to reach zero, confirming the destination has every change. Then you promote the migration job, which stops replication and makes the destination a standalone database. Finally you point the application to the destination and bring it back online.
flowchart TD
A["Announce window and freeze changes"] --> B["Stop or pause application writes"]
B --> C["Wait until lag reaches zero"]
C --> D["Validate counts and key data"]
D --> E["Promote the migration job"]
E --> F["Point application to destination"]
F --> G["Run smoke tests"]
G --> H{"All good?"}
H -->|Yes| I["Reopen to users and monitor"]
H -->|No| J["Execute rollback plan"]
Changing the railway track while a train waits at the station. You hold the train, make sure the new track is fully joined, switch the points, and only then let the train go.
Plan the way back
Before cutover, decide what you will do if something goes wrong. DMS does not support dual writing, which means writing to and reading from both the source and the destination at the same time. Once the application writes to the destination, the source falls behind. A rollback after real writes therefore needs a plan, for example keeping the source unchanged for a period, or replicating changes back with another tool. Decide this in advance, not in the middle of the incident.
Promoting before lag reaches zero. Any change not yet replicated is lost from the new database. Wait for the last change, then promote.
13Security and Compliance
Your data is most exposed while it travels, so protect the journey.
Encryption in transit
DMS migrates data securely using SSL and TLS certificates to encrypt network connections. Always enable encryption between source and DMS, particularly when the traffic crosses the public internet. Private paths such as VPN or Interconnect add another layer.
Encryption at rest and your own keys
Destination databases encrypt stored data. For continuous migrations, DMS supports customer managed encryption keys, so that you control the keys through Cloud KMS when regulations demand it.
Least privilege
The migration user on the source needs only the permissions required for reading data and change logs. People in your Google Cloud project should be given roles that allow them to create and manage migration jobs only if their work requires it. Remove access when the project ends.
Dedicated migration user
A separate account with minimal rights, easy to disable at the end.
Encrypted connections
Use SSL or TLS on every link. Never send database traffic unencrypted.
Private networking
Prefer VPN, Interconnect or peering over open internet paths.
Key control
Use customer managed keys where policy requires ownership of encryption keys.
Access review
Limit who can start, stop and promote jobs, and review audit logs of their actions.
Data handling rules
Check legal rules about moving personal data across regions or countries before choosing the destination region.
14Understanding Cost and Pricing
The tool is only one piece of the migration budget.
Pricing for DMS has been structured so that homogeneous migrations carry no charge for the migration service itself, while heterogeneous migrations are billed based on the volume of data processed, with a monthly free allowance. Because pricing terms can change, check the current official pricing page before budgeting. Remember that DMS is only one cost. The larger numbers usually come from the destination database, the network and the people.
| Cost item | Where it comes from | How to control it |
|---|---|---|
| Migration service | Heterogeneous data volume above any free allowance | Migrate only needed databases and tables |
| Destination instance | Cloud SQL or AlloyDB size, storage and high availability | Right-size, and scale after cutover if needed |
| Network | Interconnect, VPN and data transfer | Compress, schedule and avoid repeated full copies |
| Running both systems | Source and destination during the overlap | Keep the overlap short and decommission quickly |
| Engineering time | Conversion, testing and application changes | Rehearse early and automate repeatable steps |
A migration job that is left running after cutover, or a test destination that is never deleted, keeps costing money. Clean up everything the project created once it is complete.
15Real-World and Industry Examples
Where Database Migration Service earns its keep.
These are typical patterns rather than named customer stories, since company details and contracts change over time.
Data center exit
A company closes an old server room. It moves dozens of MySQL and PostgreSQL databases to Cloud SQL using continuous migrations, one application at a time, with each cutover scheduled in a quiet hour.
Escaping commercial database licensing
An enterprise moves Oracle databases to PostgreSQL on Cloud SQL or AlloyDB to reduce licensing cost, using conversion workspaces and a long testing period for stored code.
Consolidating after an acquisition
Two companies merge, and databases spread across different providers are brought into one Google Cloud environment for easier governance.
From self-managed to managed
A startup that installed MySQL on virtual machines moves to Cloud SQL, gaining automatic backups, patching and high availability without hiring a database administrator.
Retail season readiness
A retailer moves its order database before the holiday season to take advantage of read replicas and easier scaling, completing the cutover well before peak traffic.
Regulated industries
A bank migrates with private connectivity, customer managed keys, strict approval gates and detailed validation reports to satisfy auditors.
Multi-cloud continuous replication
A team keeps a copy of a database running in Google Cloud for a period while the original runs elsewhere, for testing or phased transition.
16Advantages, Disadvantages and Trade-offs
A focused tool with clear strengths and clear limits.
Advantages
- Minimal downtime through continuous replication
- Serverless, with no migration servers to build or tune
- Source stays fully operational during the copy
- Built-in progress status and lag metrics
- Schema and code conversion help for heterogeneous moves
- Encrypted connections and customer managed key support
Disadvantages / Trade-offs
- Targets only Cloud SQL and AlloyDB for PostgreSQL
- Limited set of supported source and destination pairs
- Source needs preparation, such as change logging and a migration user
- No dual-write support, so rollback after cutover needs planning
- Heterogeneous moves still need heavy testing and application work
- Regional design means every related entity must share one region
A moving company that is expert at moving houses into one particular city. It makes that journey smooth, but you cannot ask it to move you anywhere else.
17Common Problems and How to Think About Them
Troubleshooting is easier when you know the usual suspects.
Cannot connect to the source
Usually a firewall, wrong address, expired credential or missing network route. Test connectivity from the network DMS uses.
Permission errors
The migration user lacks a required right. Compare its permissions with the documented prerequisites for your engine.
Replication lag keeps growing
Check destination size, network capacity, large transactions and missing indexes on destination tables.
Source disk filling up
Change logs pile up while the snapshot is slow or the job is paused. Monitor disk space and resolve delays quickly.
Unsupported features
Some data types, extensions or objects may not migrate automatically. Identify them in rehearsal and plan manual steps.
Schema changes during migration
Changing table structure on the source while the job runs can break replication. Freeze structure changes during the migration period.
Read the exact error
Start with the status message and logs, not guesses.
Check the basics
Credentials, network path, source settings and free disk space on both sides.
Compare with prerequisites
Walk through the documented requirements for your specific source and destination pair.
Fix, restart and observe
Apply one change at a time and watch whether lag and status improve.
Keep a written log of what you changed and when. During a long migration, a clear history saves hours of confusion and helps the next migration go faster.
18Design Patterns and Anti-patterns
Habits that make migrations boring, and habits that make them dramatic.
Patterns that work
Successful teams migrate in small waves, starting with low-risk databases so they learn the process. They rehearse the entire migration on a copy and measure timings. They automate repeatable steps with scripts and infrastructure as code. They separate the data migration from the application modernization, so there are fewer moving parts at once. They agree on cutover criteria in advance, such as lag below a threshold and all validation checks passed, and they write a rollback plan.
Problem
The team runs the production migration for the first time on the actual cutover weekend.
Why It’s Harmful
Unknown copy times, missing permissions and network surprises appear under maximum pressure, and there is no time to fix them.
Correct Approach
Rehearse the full process on a recent copy, record the timings, and refine the plan until it is routine.
Problem
The destination instance is sized to the minimum to save money during the migration.
Why It’s Harmful
A small destination applies changes slowly, lag grows, and the cutover window stretches. The initial load also takes far longer.
Correct Approach
Size the destination generously for the migration period, then reduce size after cutover when real load is known.
Problem
The administrator account of the source is used as the migration user and shared by several people.
Why It’s Harmful
Broad rights and shared passwords increase the damage of any mistake or leak, and no one can say who did what.
Correct Approach
Create a dedicated migration user with minimal rights, and disable it as soon as the project ends.
Problem
Cutover is declared successful because the data copy finished, without testing the application.
Why It’s Harmful
Matching data does not guarantee matching behavior. Differences in queries, settings and performance show up only when the application runs.
Correct Approach
Run full application tests, compare critical reports, and test performance before switching users.
Problem
The old source database is deleted immediately after cutover.
Why It’s Harmful
If a hidden problem appears a few days later, there is nothing to compare against or recover from.
Correct Approach
Keep the source in read-only mode for an agreed safety period, take a final backup, and only then retire it.
19Best Practices and Common Mistakes
A checklist you can follow from the first meeting to the final shutdown.
Assess first
Know every database, version, size, feature and dependency before choosing a migration path.
Choose the right type
Use continuous migration for systems that cannot stop, and one-time migration for small or flexible workloads.
Secure the path
Encrypt connections, use private networking where possible and use dedicated, narrow credentials.
Rehearse and measure
Practice the full migration and cutover, and record real timings to set the schedule.
Monitor lag and alerts
Watch status, lag and disk space on both sides throughout.
Define cutover criteria and rollback
Agree on exact go and no-go conditions, and prepare the way back before you need it.
Validate thoroughly
Compare data, run application tests and review performance before and after switching.
Clean up
Delete migration jobs, temporary firewall rules and test accounts, and retire the source only after a safe waiting period.
Mistakes beginners make most often
The first is skipping the rehearsal. The second is under-sizing the destination. The third is promoting before lag reaches zero. The fourth is underestimating application changes in a heterogeneous migration. The fifth is forgetting that the source needs preparation before continuous replication can start. The sixth is leaving temporary access open when the work is done.
Tell business teams and customers about the cutover window early, and give them a simple way to report problems. Calm communication turns a technical event into a non-event.
20When to Use Other Tools Instead
DMS is excellent at one job, and other tools handle neighboring jobs.
DMS is built to move relational databases into Cloud SQL and AlloyDB. For other goals, other Google Cloud services or approaches may suit better.
| Goal | Suitable approach | Why |
|---|---|---|
| Move relational databases to Cloud SQL or AlloyDB with low downtime | Database Migration Service | Purpose built, serverless, continuous replication |
| Stream database changes into BigQuery for analytics | Datastream | A change data capture service for feeding analytics and other destinations |
| Move virtual machines running databases as-is | Migrate to Virtual Machines | Moves whole machines rather than databases |
| Move very large files or object storage | Storage Transfer Service | Designed for bulk file and object movement |
| Small database with ample downtime | Native export and import tools | Simple, no extra service needed |
| Move to a destination DMS does not support | Engine specific tools or partner products | Wider range of targets |
flowchart TD
Q1{"Is the destination Cloud SQL or AlloyDB?"} -->|No| OT["Use another tool such as Datastream or native tools"]
Q1 -->|Yes| Q2{"Is the source a supported engine?"}
Q2 -->|No| OT
Q2 -->|Yes| Q3{"Can the application stop for the whole copy?"}
Q3 -->|Yes| ON["One-time migration may be enough"]
Q3 -->|No| CO["Use continuous migration"]
A van, a freight train and a courier bike all move things, but each fits a different load. Pick the vehicle that matches the cargo and the destination.
21Frequently Asked Questions
It is a serverless Google Cloud service that migrates databases into Cloud SQL and AlloyDB for PostgreSQL, using an initial copy plus continuous replication so downtime stays small.
Not during a continuous migration. The source stays in use while data is copied and synchronized. You need a short pause only at the moment of cutover.
Common sources include MySQL, PostgreSQL, SQL Server and Oracle. Destinations are Cloud SQL and AlloyDB for PostgreSQL. Exact supported pairs and versions are listed in the documentation, so verify them first.
Homogeneous keeps the same database technology, such as MySQL to Cloud SQL for MySQL. Heterogeneous changes technology, such as Oracle to PostgreSQL, and needs schema and code conversion.
Yes, when configured correctly. DMS uses SSL and TLS to encrypt network connections, and continuous migrations support customer managed encryption keys.
It depends on data size, network speed, destination size and database activity. Small databases may finish in minutes or hours, while large ones can take days. A rehearsal gives the most reliable estimate.
Promote ends replication and turns the destination into a standalone primary database that your application can read and write. After promotion the source and destination are no longer kept in sync.
No. DMS does not support dual write. Plan your cutover so that writes move from the source to the destination at one clear moment.
It helps convert database schema and database stored code in heterogeneous migrations, with Gemini assisted suggestions. Your application’s own code and queries still need review and testing by your developers.
The job shows an error status. You read the message, fix the cause, such as connectivity or permissions, and restart or resume as the documentation allows. The source is not harmed, because DMS only reads from it.
Pricing has differed by migration style, with same-technology migrations typically carrying no service fee and heterogeneous ones billed by data volume above a free allowance. You still pay for the destination database and network. Check the current pricing page.
Monitor the new database closely, enable backups and high availability if not already on, tune performance, remove temporary access and migration jobs, and keep the source read-only for a safety period before retiring it.
22Summary and Key Takeaways
Database Migration Service is Google Cloud’s serverless tool for moving relational databases into Cloud SQL and AlloyDB for PostgreSQL. It takes an initial snapshot, then keeps the destination in step using Change Data Capture, so your application can keep running until a short, controlled cutover. Success depends on choosing the right migration type, preparing the source, securing the network path, rehearsing, watching replication lag, validating carefully, and planning the way back. Treat the tool as the engine of the move and your own planning as the steering wheel.
Key Takeaways
- Serverless and low downtime — an initial snapshot plus continuous replication keeps the source in use until cutover.
- Know your style — homogeneous moves keep the same technology, heterogeneous moves need schema and code conversion and much more testing.
- Prepare the source — enable change logging, create a narrow migration user and choose a secure, adequate network path.
- Everything lives in one region — profiles, jobs, workspaces and destination must share a region, so choose it early.
- Watch replication lag — only promote when lag reaches zero and validation checks have passed.
- Plan the rollback — DMS does not support dual write, so decide in advance how you would return if the cutover fails.
- Rehearse and clean up — practice the full migration first, then remove jobs, access and old systems after a safe waiting period.