Opsio - Cloud and AI Solutions
9 min read· 2,143 words

Database Migration to Cloud: Real-World Examples

Udgivet: ·Opdateret: ·Gennemgået af Opsios ingeniørteam
Fredrik Karlsson

Migrating databases to the cloud is one of the most consequential infrastructure decisions an organization can make, and real-world projects reveal patterns that planning documents rarely capture. Whether you are moving a single PostgreSQL instance to AWS RDS or re-platforming an entire Oracle estate onto Azure SQL, the lessons below come from documented migration efforts across industries including financial services, healthcare, retail, and SaaS companies.

This guide walks through practical examples of database migration to cloud environments, the strategies that worked, the mistakes that caused downtime, and the best practices that separate successful projects from costly failures. If your organization is considering an on-premise to cloud migration, these case-driven insights will help you plan with confidence.

Why Organizations Migrate Databases to the Cloud

Most database migrations are driven by a combination of cost pressure, scalability needs, and the desire to offload undifferentiated infrastructure management. According to Gartner, more than 75% of databases will be deployed or migrated to a cloud platform by 2025, up from 50% in 2022. The primary motivations include:

  • Elastic scalability -- cloud-managed databases scale compute and storage independently, eliminating over-provisioning.
  • Reduced operational overhead -- patching, backups, failover, and monitoring shift to the cloud provider.
  • Improved disaster recovery -- multi-region replication is built into services like Amazon Aurora, Azure SQL, and Google Cloud SQL.
  • Cost optimization -- reserved instances and serverless database options (Aurora Serverless, Azure SQL Serverless) reduce idle-time costs by 40-70% compared to always-on on-premise servers.
  • Modern data capabilities -- cloud databases integrate natively with analytics, machine learning, and real-time streaming services.

However, motivation alone does not guarantee success. The examples below show what happens when planning meets reality.

Real-World Example 1: Retail Company Migrating SQL Server to Azure SQL

A mid-size retail chain with 200+ stores migrated its on-premise SQL Server 2016 estate to Azure SQL Database, cutting infrastructure costs by 35% while improving query performance.

The Challenge

The company operated 14 SQL Server databases supporting POS systems, inventory management, and e-commerce. Peak holiday traffic caused performance degradation, and the IT team spent 30% of their time on patching and backup management.

The Approach

They used the Azure Database Migration Service (DMS) for a phased migration:

  1. Assessment phase using Azure Migrate and Data Migration Assistant (DMA) to identify compatibility issues.
  2. Schema migration first, followed by continuous data replication.
  3. Cutover during a planned 4-hour maintenance window per database group.

Key Lessons

  • DMA flagged 23 compatibility issues, mostly related to cross-database queries and CLR assemblies that Azure SQL does not support. These required refactoring before migration.
  • The team underestimated network bandwidth requirements. Initial data sync took 3x longer than projected because the VPN tunnel was shared with production traffic.
  • Post-migration, they moved to Azure SQL elastic pools, saving an additional 20% by sharing resources across databases with different peak times.

Real-World Example 2: SaaS Startup Moving PostgreSQL to AWS Aurora

A B2B SaaS company serving 500 enterprise clients migrated from self-managed PostgreSQL on EC2 to Amazon Aurora PostgreSQL, achieving 3x read throughput and 99.99% availability.

The Challenge

The startup managed PostgreSQL 13 on EC2 instances with manual replication. As their customer base grew, read replicas lagged, failover was manual, and the two-person database team could not keep pace with scaling demands.

The Approach

They used AWS Database Migration Service (DMS) with continuous replication:

  1. Created an Aurora PostgreSQL cluster with read replicas in two availability zones.
  2. Set up DMS for ongoing replication from the source EC2 PostgreSQL instance.
  3. Ran both systems in parallel for two weeks, validating data consistency with row-count and checksum comparisons.
  4. Switched application connection strings to Aurora endpoints during a 15-minute maintenance window.

Key Lessons

  • Aurora's storage auto-scaling eliminated the need to pre-provision disk space, which had caused two outages in the previous year.
  • The team discovered that certain PostgreSQL extensions (e.g., pg_repack) were not available on Aurora, requiring alternative approaches to table bloat management.
  • DMS replication lag averaged under 100ms, but large batch operations caused temporary spikes. They resolved this by throttling batch jobs during migration.

Real-World Example 3: Healthcare Organization Migrating Oracle to Google Cloud SQL

A regional healthcare provider migrated its Oracle 19c databases to Google Cloud SQL for PostgreSQL, reducing annual licensing costs by over $400,000 while meeting HIPAA compliance requirements.

The Challenge

Oracle licensing costs consumed 40% of the IT budget. The organization needed to maintain HIPAA compliance, ensure zero data loss during migration, and retrain staff on PostgreSQL.

The Approach

This was a re-platform migration (not lift-and-shift) because they changed database engines:

  1. Used Ora2Pg for schema conversion and initial data migration assessment.
  2. Rewrote PL/SQL stored procedures in PL/pgSQL -- this was the most time-consuming phase, taking 4 months.
  3. Migrated data using Google Database Migration Service with encryption in transit and at rest.
  4. Conducted parallel-run testing for 6 weeks before decommissioning Oracle.

Key Lessons

  • Schema conversion was 80% automated, but the remaining 20% (stored procedures, triggers, and custom functions) required manual rewriting and testing.
  • HIPAA compliance on Google Cloud SQL required configuring Customer-Managed Encryption Keys (CMEK), audit logging, and VPC Service Controls.
  • Staff training on PostgreSQL took 3 months. The team recommended starting training before migration begins, not after.

Common Database Migration Strategies Compared

Choosing the right migration strategy depends on your tolerance for downtime, budget, and whether you are changing database engines. The table below compares the most common approaches used in real-world projects:

StrategyBest ForDowntimeComplexityRisk Level
Lift and ShiftSame engine, quick migrationHoursLowLow
Re-platformEngine change (e.g., Oracle to PostgreSQL)Planned windowHighMedium
Continuous ReplicationNear-zero downtime requirementMinutesMediumLow-Medium
Dual-WriteGradual cutover with rollbackNoneVery HighMedium
Blue-Green DeploymentCritical production databasesSecondsHighLow

In our observed projects, continuous replication with a short cutover window was the most popular approach, used in roughly 60% of migrations. Lift-and-shift was common for organizations staying within the same database engine, while re-platforming was chosen primarily to escape licensing costs.

Database Migration Best Practices From Real Projects

Across the projects we have studied, six best practices consistently separated successful migrations from troubled ones.

1. Conduct a Thorough Pre-Migration Assessment

Every successful migration started with a comprehensive assessment of dependencies, data volumes, schema complexity, and application coupling. Tools like AWS Schema Conversion Tool, Azure Data Migration Assistant, and Google Migrate for Compute Engine automate much of this discovery. Skipping assessment was the number-one cause of migration delays in the projects reviewed.

2. Choose the Right Cloud Database Service

Not all managed database services are equal. Consider these factors when selecting between providers:

  • Engine compatibility -- AWS Aurora supports MySQL and PostgreSQL; Azure SQL is optimized for SQL Server workloads; Google Cloud SQL supports MySQL, PostgreSQL, and SQL Server.
  • Performance requirements -- Aurora offers up to 5x MySQL throughput; Azure Hyperscale supports 100TB+ databases.
  • Multi-region needs -- Google Cloud Spanner provides global consistency; Aurora Global Database offers cross-region replication with sub-second lag.
  • Cost model -- serverless options (Aurora Serverless, Azure SQL Serverless) work well for variable workloads.

3. Develop a Robust Data Validation Strategy

Data integrity verification must happen before, during, and after migration. Successful teams used row counts, checksum comparisons, and application-level validation queries. One retail migration caught a character encoding issue that would have corrupted 12,000 product descriptions -- found only because they ran validation scripts before cutover.

4. Plan for Security and Compliance From Day One

Security cannot be an afterthought. Every migration in regulated industries (healthcare, finance) required encryption in transit and at rest, network isolation via VPC/VNet, identity and access management policies, and audit logging. Cloud migration risk assessment should begin during the planning phase, not after data starts moving.

5. Monitor Performance Post-Migration

Query performance often changes after migration due to differences in query optimizers, storage engines, and network latency. Successful teams established baseline metrics before migration and monitored for regressions for at least 30 days post-cutover. Cloud-native monitoring tools like Amazon CloudWatch, Azure Monitor, and Google Cloud Operations Suite provide the visibility needed to catch issues early.

6. Build Rollback Plans You Actually Test

Every migration plan included a rollback strategy, but only the successful ones actually tested it. One financial services company ran a full rollback drill two weeks before their production migration and discovered their backup restoration process took 6 hours instead of the expected 2 -- knowledge that changed their cutover timing.

Common Database Migration Challenges and How to Avoid Them

Even well-planned database migration to cloud projects encounter obstacles, but most challenges are predictable and preventable.

  • Data type incompatibilities -- Different database engines handle data types differently. Oracle's NUMBER type does not map directly to PostgreSQL's NUMERIC in all cases. Always run schema conversion tools and review the output manually.
  • Application connection management -- Hardcoded connection strings, connection pooling configurations, and DNS TTL settings can cause extended downtime if not updated. Use DNS-based endpoints and reduce TTL values before cutover.
  • Stored procedure migration -- Re-platforming projects consistently reported that stored procedure conversion consumed 40-60% of the total migration effort. Start this work early and allocate sufficient testing time.
  • Network throughput -- Large databases (10TB+) require dedicated network connections (AWS Direct Connect, Azure ExpressRoute, Google Cloud Interconnect) rather than VPN tunnels. Calculate transfer times before committing to a migration window.
  • Performance regression -- Query plans change between engines and between on-premise and cloud configurations. Capture the top 100 queries by execution time before migration and benchmark them against the target environment.

Database Migration Tools by Cloud Provider

Each major cloud provider offers native migration tools, and choosing the right one depends on your source database and target service.

ProviderToolSource SupportKey Feature
AWSDatabase Migration Service (DMS)Oracle, SQL Server, MySQL, PostgreSQL, MongoDBContinuous replication with minimal downtime
AWSSchema Conversion Tool (SCT)Oracle, SQL Server, TeradataAutomated schema and code conversion
AzureAzure Database Migration ServiceSQL Server, MySQL, PostgreSQL, Oracle, MongoDBOnline and offline migration modes
AzureData Migration Assistant (DMA)SQL ServerCompatibility assessment and feature parity analysis
GoogleDatabase Migration ServiceMySQL, PostgreSQL, SQL Server, OracleServerless, minimal configuration
Multi-cloudOra2PgOracleOpen-source Oracle to PostgreSQL conversion

Planning Your Database Migration: A Step-by-Step Checklist

Use this checklist to structure your database migration to cloud project based on the patterns observed in successful real-world implementations.

  1. Inventory and classify -- Document all databases, their sizes, dependencies, and business criticality.
  2. Assess compatibility -- Run assessment tools to identify schema, feature, and performance compatibility issues.
  3. Select target services -- Match each database to the appropriate cloud migration strategy and managed service.
  4. Design the network -- Establish secure, high-bandwidth connectivity between source and target environments.
  5. Build and test -- Migrate to a staging environment first. Run full application test suites against migrated data.
  6. Validate data -- Compare row counts, checksums, and business-critical queries between source and target.
  7. Plan the cutover -- Define the maintenance window, communication plan, rollback criteria, and success metrics.
  8. Execute and monitor -- Perform the cutover during the planned window and monitor for 30+ days post-migration.
  9. Optimize -- Right-size instances, enable auto-scaling, and review cost reports after the first billing cycle.

For organizations that need expert guidance through this process, Opsio provides managed cloud migration services with database migration expertise across AWS, Azure, and Google Cloud.

Frequently Asked Questions

How long does a typical database migration to the cloud take?

Small to mid-size databases (under 1TB) typically migrate in 2-6 weeks including assessment, testing, and cutover. Large enterprise migrations with multiple databases, engine changes, or compliance requirements can take 3-12 months. The stored procedure conversion phase is usually the longest for re-platform projects.

What is the biggest risk in cloud database migration?

Data loss or corruption during the cutover window is the most serious risk. This is mitigated by using continuous replication tools (AWS DMS, Azure DMS), running parallel systems before cutover, and implementing thorough data validation checks at every stage.

Can I migrate my database to the cloud with zero downtime?

Near-zero downtime is achievable using continuous replication followed by a quick DNS or connection string switch. True zero downtime requires dual-write patterns or blue-green deployments, which add significant complexity. Most organizations accept a brief maintenance window of minutes to a few hours.

How much does database migration to the cloud cost?

Costs vary widely based on database size, engine changes, and complexity. Migration tool costs are typically minimal (AWS DMS and Azure DMS charge only for the replication instance). The largest costs are staff time for planning, testing, and stored procedure conversion. Organizations should also budget for 1-3 months of running both source and target environments in parallel.

Should I change database engines during migration?

Change engines only if there is a clear business driver such as reducing licensing costs (Oracle to PostgreSQL) or gaining specific capabilities. Same-engine migrations (SQL Server to Azure SQL, PostgreSQL to Aurora PostgreSQL) are significantly simpler and lower risk. Re-platforming adds 2-4x the effort of a lift-and-shift migration.

Om forfatteren

Fredrik Karlsson
Fredrik Karlsson

Group COO & CISO at Opsio

Operational excellence, governance, and information security. Aligns technology, risk, and business outcomes in complex IT environments

Editorial standards: This article was written by a certified practitioner and peer-reviewed by our engineering team. We update content quarterly to ensure technical accuracy. Opsio maintains editorial independence — we recommend solutions based on technical merit, not commercial relationships.

Vil du implementere det, du lige har læst?

Vores arkitekter kan hjælpe dig med at omsætte disse indsigter til handling.