Home / Guides
Tip

What a Database Migration Actually Costs

By · November 10, 2026 · 12 min read

The short version

Database migration cost is five line items, and four of them can be measured before you sign anything: data transfer out of the source, the migration service, the weeks both systems run side by side, and the size of the target. The fifth, people time, is yours to estimate. The migration service itself is often free: Google's Database Migration Service charges nothing for same-engine moves into Cloud SQL, and Azure DMS Standard is free. In my estimate the parallel run was most of the bill. Measure database size, export size and daily change-log volume, then price them against the vendors' rate pages.

What goes into database migration cost

Line item What you measure What it is priced by
Data transfer Raw export size plus change log during the overlap Egress rate of wherever the source runs; ingress was free on every pricing page I read
Migration service Same as above, sometimes hours Per hour (AWS DMS), per GiB processed (Google DMS, other engines), free tiers (Azure DMS Standard, Google DMS same engine)
Parallel run Days from first copy to decommission Target instance and storage hours, plus the old system you keep paying for
Target sizing On-disk size, vCPU and memory you need Instance and storage rates of the target service
People time Hours Your own rates. I give no figures here

Each line is a measured quantity times a published price. Anything you cannot measure yet goes in the plan as a blank, like the open items in the database migration checklist.

What I measured, and on what

I built the same small sample database on the QA servers: MySQL 8.4.11 and PostgreSQL 16.14, three tables (20,000 customers, 300,000 orders, 900,000 order lines) with indexes on the foreign keys.

Sizes come from pg_total_relation_size, pg_relation_size and pg_indexes_size on PostgreSQL and from information_schema.TABLES on MySQL, next to an exact count(*):

== PostgreSQL 16: sizes and row counts
table         est_rows  count(*)        heap     indexes       total
order_items     900000    900000    54214656    35110912    89366528
orders          300000    300000    25600000    18087936    43720704
customers        20000     20000     1687552      466944     2187264
pg_database_size: 143277079

== MySQL 8.4: information_schema.tables and count(*)
table        table_rows  count(*)        data       index       total
order_items      897768    900000    44630016    13123584    57753600
orders           291406    300000    21544960    13664256    35209216
customers         20050     20000     1589248           0     1589248
schema total: 94552064

Identical data takes 143 MB in PostgreSQL and 95 MB in MySQL, so source size says little about target size on another engine. And MySQL's table_rows was off by 8,594 on orders. The manual says that for InnoDB it is an approximation that "may vary from the actual value by as much as 40% to 50%". If a quote is built on row counts, get them with count(*). The PostgreSQL estimates matched exactly, read right after a VACUUM ANALYZE.

Raw size vs compressed dump size

Transfer and per-GiB migration charges follow the bytes that move, which is neither the on-disk size nor a compressed backup. I exported the PostgreSQL tables with COPY ... TO STDOUT through psycopg2 (no pg_dump on this laptop) and ran mysqldump --single-transaction against MySQL, then compressed both:

== sizes in bytes
pg_copy.txt    raw   55111263  gzip -6   14721906  zstd -3    8706777
my_dump.sql    raw   63136924  gzip -6   15218912  zstd -3    9614822

The raw export was 38% of PostgreSQL's on-disk size and 67% of MySQL's: no indexes, no free space in pages. gzip took it to about a quarter. Generated data repeats itself, so compress a sample of your own tables rather than using my ratio. Compression helps only when you ship a file; Google says that its DMS counts bytes "based on raw (uncompressed) data".

How fast does the data change?

The second byte count is the change stream a CDC tool ships during the overlap (how it works: Zero Downtime Database Migration with CDC). I ran 60 seconds of generated traffic against each server at 20 transactions a second, each one a new order with three lines plus a status update on an old order, and measured the binary log and the WAL before and after. The rate is my choice, the bytes are measured:

== MySQL {'binlog_format': 'ROW', 'binlog_row_image': 'FULL', 'binlog_transaction_compression': 'OFF'}
transactions 1200 in 60.0 s, binlog bytes 1184958, bytes per transaction 987, table maps from other databases 0
== PostgreSQL wal_level=replica full_page_writes=on
transactions 1200 in 60.0 s, WAL bytes 2064432, bytes per transaction 1720 (server-wide)

About 1 KB of binlog per transaction on MySQL. With the default binlog_row_image=full, an update logs every column in both the before and the after image, so wide tables with frequent updates produce much more. PostgreSQL wrote 1.7 KB of WAL per transaction, server-wide. At 20 transactions a second around the clock, that MySQL figure is 1,706,339,520 bytes, 1.59 GiB, a day. On a real server, skip the synthetic load and read the logs a day apart (commands at the end).

Data transfer: egress pricing

Ingress is free everywhere I looked: AWS DMS says "All data transfer into AWS DMS is free" and free between DMS and RDS or EC2 in the same Availability Zone, Cloud SQL lists ingress as free, and Azure bandwidth lists data transfer in as free. You pay on the way out, at the source's rates. As of October 2026:

From your own data centre, the line is whatever your link costs.

Migration service cost: AWS DMS, Azure DMS, Google DMS

As of October 2026:

So with AWS DMS, the hours count, and the overlap period drives them. With Google, the bytes count, and only across engines.

Running both systems in parallel during cutover

From the first full copy until the old server is switched off, you pay for both, plus the replication between them. Two weeks of overlap is two weeks of target bill before a single user is on it.

For the target I used Cloud SQL Enterprise edition, general purpose, Iowa, with high availability, as of October 2026: $0.0826 per vCPU-hour, $0.014 per GiB of memory per hour, and $0.000465753 per GiB-hour of SSD. The same page notes that read replicas and failover replicas are charged at the same rate as stand-alone instances, so a replica you add for the cutover is another full instance on the bill.

Target sizing

Measure on-disk size and the CPU and memory your current server uses at peak; headroom is your decision. For the sample I picked 4 vCPU and 16 GiB as an example, not a recommendation, and storage equal to the measured size. Add your own growth on top.

People time

The one line I cannot measure for you: schema conversion, rewriting engine-specific code, testing, validation runs, the cutover night, and answering "why is this report different" afterwards. Count it in hours from your own team's plan. I give no salary or day-rate figures; none of them would be yours.

The estimate script, and what it printed

Measured inputs go in as arguments; unit prices sit in one dictionary, each with its source page. A price that did not render is None and prints "fill in", so a missing number shows as a blank, never as zero. Trimmed:

PRICES = {
    # azure.microsoft.com/en-us/pricing/details/bandwidth/ - internet egress,
    # Microsoft network, from North America or Europe, per GB (1 TB = 1,000 GB)
    "azure_egress_tiers_gb": [(100, 0.0), (10_000, 0.087), (40_000, 0.083),
                              (100_000, 0.07), (350_000, 0.05)],
    # cloud.google.com/sql/pricing - ingress free; egress from Cloud SQL to the internet
    "cloudsql_ingress_gib": 0.0,
    "cloudsql_internet_egress_gib": 0.19,
    # cloud.google.com/sql/pricing - Enterprise edition, general purpose, Iowa, HA rates
    "cloudsql_ha_vcpu_hour": 0.0826,
    "cloudsql_ha_mem_gib_hour": 0.014,
    "cloudsql_ha_ssd_gib_hour": 0.000465753,
    # cloud.google.com/database-migration/pricing - Iowa
    "gdms_homogeneous": 0.0,
    "gdms_backfill_free_gib": 500, "gdms_backfill_gib": 0.40,
    "gdms_cdc_tiers_gib": [(2_500, 2.00), (2_500, 1.50), (5_000, 1.20), (math.inf, 0.80)],
    # aws.amazon.com/dms/pricing/ - instance and storage rate tables did not render
    "aws_dms_instance_hour": None,
}
...
moved_bytes = a.export_bytes + a.changelog_bytes_per_day * a.overlap_days
out_gb = moved_bytes / GB
lines.append(("transfer out of source (Azure egress)", tiered(out_gb, p["azure_egress_tiers_gb"]),
              f"{out_gb:,.2f} GB"))
...
inst = hours * (a.vcpu * p["cloudsql_ha_vcpu_hour"] + a.mem_gib * p["cloudsql_ha_mem_gib_hour"])
stor = hours * storage_gib * p["cloudsql_ha_ssd_gib_hour"]

The scenario: the MySQL sample sits on an Azure VM, moves to Cloud SQL for MySQL with Google DMS, a 14-day overlap, and a reverse change stream kept running as the rollback path. Inputs are the measured MySQL size, mysqldump size and binlog rate:

$ python estimate.py --disk-bytes 94552064 --export-bytes 63136924 --changelog-bytes-per-day 1706339520 --overlap-days 14 --vcpu 4 --mem-gib 16 --rollback-stream
inputs: disk 0.09 GiB, export 0.06 GiB, change log 1.59 GiB/day, overlap 14 days
transfer out of source (Azure egress)         $0.00   23.95 GB
transfer into Cloud SQL                       $0.00   ingress is free
rollback stream out of Cloud SQL              $4.23   22.25 GiB
Google DMS, same engine                       $0.00   no additional charge
Google DMS, different engine                 $44.50   backfill 0.06 GiB, CDC 22.25 GiB
AWS DMS instance hours                      fill in   336 h
Cloud SQL HA during overlap                 $186.43   4 vCPU, 16 GiB, 1 GiB SSD, 336 h
people time                                 fill in   yours to estimate
known total (same-engine path)              $190.66   plus every 'fill in' line
target after cutover, per 30 days           $399.50

Then the same change rate with the size multiplied by 10,000, about 900 GiB. The multiplier is mine, and it keeps the sample's export-to-disk ratio, which your database will not share exactly:

$ python estimate.py ... --scale 10000
inputs: disk 880.58 GiB, export 588.01 GiB, change log 1.59 GiB/day, overlap 14 days
transfer out of source (Azure egress)        $48.31   655.26 GB
transfer into Cloud SQL                       $0.00   ingress is free
rollback stream out of Cloud SQL              $4.23   22.25 GiB
Google DMS, same engine                       $0.00   no additional charge
Google DMS, different engine                 $79.70   backfill 588.01 GiB, CDC 22.25 GiB
AWS DMS instance hours                      fill in   336 h
Cloud SQL HA during overlap                 $324.15   4 vCPU, 16 GiB, 881 GiB SSD, 336 h
people time                                 fill in   yours to estimate
known total (same-engine path)              $376.68   plus every 'fill in' line
target after cutover, per 30 days           $694.60

On the small database, transfer is free (under Azure's 100 GB) and the parallel run is 98% of the known bill. At 900 GiB, egress becomes $48 and storage pushes the overlap to $324, still the biggest line. The "different engine" row prices the same bytes as if the source were Oracle or SQL Server: the CDC charge at $2.00 a GiB is set by the change rate, not the size, and a busy database with a long overlap makes it the line to watch. The script treats the whole migration as one billing month; a migration that crosses a month boundary gets the free allowances twice. The old server's cost during those 14 days is already on your bill, so it is not in the script.

Measure your own inputs

On the real source, at a normal week's load. Sizes, exact:

-- PostgreSQL
SELECT relname, pg_total_relation_size(oid) FROM pg_class
WHERE relkind = 'r' AND relnamespace = 'public'::regnamespace ORDER BY 2 DESC;
-- MySQL: sizes from information_schema, rows from count(*) per table
SELECT table_name, data_length + index_length FROM information_schema.tables
WHERE table_schema = 'yourdb' ORDER BY 2 DESC;

Change rate, a day apart: on MySQL, SHOW BINARY LOGS and sum File_size for the files written in that day; on PostgreSQL, save SELECT pg_current_wal_lsn() and the next day run SELECT pg_wal_lsn_diff(pg_current_wal_lsn(), '<saved value>'), which returns the difference in bytes. PostgreSQL's figure covers the whole server.

Export size: dump one large table and scale by its share of the database. Then run the script with your numbers, after checking each pricing page for your Region, because every price above is dated October 2026.

Sources