Skip to Content
Cloud Engineering Academy
Projects

Capstone 6: Legacy .NET Framework migration

Move the core of a fictional legacy .NET Framework estate to AWS in six stages: assess with the 7 Rs, port and containerise (a plan, since the legacy code does not exist), migrate SQL Server to RDS PostgreSQL with DMS, prove the data matches with a tested reconciler, cut over behind a go/no-go gate with weighted DNS, and keep a rollback that has been rehearsed. Built on the Module 13 lab plus Terraform and a small tested cut-over tool.

advanced⏱ 12 h 🟡 Low costSAP-C03SAA-C03

Assumes: .NET 10 LTS · AWS DMS · Amazon RDS for PostgreSQL · Route 53 weighted records · Terraform 1.10+ with AWS provider 6.x · AWS CLI v2 · Region us-east-1. Verified against official sources on 2026-11-18.

What you are building

A migration, not an application. The fictional Harbourline Branch Ledger Suite is a typical legacy estate: an ASP.NET Web Forms portal, a WCF and MVC 5 ledger service on Entity Framework 6, a Windows service that makes statements, an SSIS end-of-day batch, a SQL Server 2016 database and a file share of statement PDFs. You move its core to AWS in six stages:

  1. Assess. Classify every component with the 7 Rs and group them into waves. The Module 13 classifier does this, and its generated report is part of the repository.
  2. Port and containerise. .NET Framework 4.8 to .NET 10, WCF to REST or CoreWCF, EF6 to EF Core, a container image. This is a written plan, because no legacy source code exists in the repository.
  3. Migrate the data. AWS DMS full load plus change data capture (CDC) from SQL Server into a private, encrypted RDS PostgreSQL database, defined in Terraform.
  4. Prove the data matches. A small tested reconciler compares per-table row counts and decimal-exact totals across the two engines.
  5. Cut over. A go/no-go gate (nine checks, tested) decides whether the window may proceed; then a weighted Route 53 record moves traffic.
  6. Roll back. A runbook with two rollback variants and a point of no return derived from a measured time, not an opinion.

Educational project

The application is invented for this course and copies no real product. The legacy "server" is something you provide (a SQL Server container on your own machine is enough). Nothing here makes a migrated system compliant with any regulation, and nothing was deployed to AWS when this page was written. All data is fictional.

Learning objectives

By the end you can:

  • Classify a mixed estate with the 7 Rs, defend each choice, and name one reason you might disagree with the tool.
  • Explain why DMS is neither the data validation nor the rollback.
  • Describe the three biggest risks of a SQL Server to PostgreSQL move (schema and T-SQL conversion, decimal and date semantics, identity and sequence values) and the test for each.
  • Run a cut-over as a sequence with roles, times, evidence and stop conditions, and say why a percentage canary is unsafe for a single-writer ledger.
  • Pick the point of no return from the measured duration of the reverse path.
  • Deploy a rehearsal, reconcile it, cut over and roll back on purpose, and tear everything down.

The architecture

The repository adds the cut-over and rollback sequence and the security-boundary view in projects/p6-legacy-dotnet-migration/docs/architecture.md.

What the assessment decided

The classifier ran on the fictional inventory with --today 2026-11-18. Ten components, seven strategies considered:

StrategyComponents
Refactor to .NET 10 and containersLedger service, statement generator, interest-calculation library
ReplatformLedger database (to a managed database), statement share (to S3 or a managed file service), the Web Forms portal (stay on .NET Framework for now because of hard blockers, strangle out later)
RehostThe SSIS end-of-day batch (few changes, little return from rewriting)
RetainThe partner FTP job (decommission already planned), the passbook printer drivers (needs on-premises hardware)
RetireThe old branch forms intranet (no active users in 90 days)

Two waves: the pilot (portal, interest library), then the ledger core (database, share, batch, ledger service, statement generator). The full table, with the rule that fired for each row, is docs/assessment-report.md.

The cut-over gate

CheckWhat it protects
Change window is open, with enough time left to finish or roll backStarting a cut-over you cannot finish
Point of no return is defined and inside the windowAn undefined rollback boundary
Source is frozenWrites landing on the old side after the last copy
Replication has drainedLost transactions
Reconciliation is cleanSilent data differences between engines
All smoke tests pass on the new systemA system that is up but wrong
Rollback was rehearsed recentlyA rollback that has never been run
All approvals recordedSeparation of duties

A No-Go is a successful outcome of the gate: it did its job. The sample data shows both a GO and a NO-GO.

Prerequisites and the lessons it builds on

What is in the repository

WhereWhat
labs/m13-migration-classifierThe classifier, wave planner and report tool, with its tests. Referenced, not copied
projects/p6-legacy-dotnet-migration/dataThe fictional inventory and the sample statistics and gate inputs, including a deliberately drifted target
projects/p6-legacy-dotnet-migration/docsArchitecture, assessment report, migration plan, cut-over runbook, four ADRs, security controls, testing, monitoring, cost and teardown
projects/p6-legacy-dotnet-migration/infra/terraformThe target database, DMS, and the weighted DNS records
projects/p6-legacy-dotnet-migration/src and testsThe reconciler and the go/no-go gate (31 tests)
projects/p6-legacy-dotnet-migration/sqlTable-statistics scripts for SQL Server and PostgreSQL: untested templates

The four ADRs: refactor the ledger service to .NET 10 containers, SQL Server to RDS PostgreSQL with DMS, hybrid connectivity and statement storage, and weighted DNS cut-over with rollback.

Build path

Assess (free). Run the classifier on the inventory and compare its output with the checked-in assessment report. Write one sentence per component saying whether you agree.

Read the plan and run the gate offline (free). Run the 31 tests, then the gate on the clean statistics (GO) and on the drifted statistics (NO-GO, with three mismatches). Write your own gate inputs for a NO-GO you choose.

Port (design). Follow stage 2 of the migration plan on a sample service of your own: golden-file tests for every money calculation first, then WCF, EF6 and Windows authentication replacements.

Migrate a rehearsal. Create the source secret by hand, convert and review the target schema, apply the Terraform with your VPC and subnet IDs, start the DMS task and watch lag and validation. Reconcile twice, with edge-case rows inserted on purpose.

Cut over and roll back a rehearsal. Set the weighted record to 100 percent for the new side, then back to 0. Time both. The point of no return comes from the reverse-path time.

Tear down the same day: DMS instance first, then everything else, and prove nothing is left.

What was verified when this page was written

CheckResult
Cut-over tool suite (Docker, .NET 10 SDK)31 passed, 0 failed
Gate on the clean statisticsDecision: GO, all nine checks pass
Gate on the drifted statisticsDecision: NO-GO, exit code 1; three mismatches (a row-count difference and a sum difference on accounts, plus a table that exists only in the target)
terraform validate on infra/terraform (Terraform 1.14, AWS provider 6.x)Valid
Not runterraform apply, any DMS task, any real SQL Server or PostgreSQL (the sql/ scripts are untested), any port of application code, any cut-over or rollback. Prices are estimates. DMS engine settings, ssl_mode values and Schema Conversion behaviour are marked ⚠ VERIFY in the repository docs

Security controls

The repository's docs/security-controls.md lists thirteen controls with how to verify each. The ones that define this design:

ControlHow it is shown
No public endpointsThe database and the DMS instance have no public access; the describe commands show it
Only DMS and the app reach the databaseSecurity-group references, no CIDR source on the database group
Encryption in transit and at restTLS on both endpoints, customer-managed KMS key with rotation for storage, secrets and the DMS instance
No passwords in code or stateRDS generates and rotates the target secret; the source login is a hand-made secret passed by ARN
Integrity is proved, not assumedDecimal-exact per-table totals compared across engines; any mismatch is a No-Go
Writes are controlled at cut-overThe source is frozen first and the gate refuses to proceed otherwise
Separation of dutiesFour recorded approvals; the person running the runbook is not the only approver
Residual data is handledThe DMS instance and migration secrets are deleted after the watch period; the legacy database is archived under the retention policy

Honest gaps: a single-AZ DMS instance and rehearsal database, no WAF and no VPC endpoints in this folder, local Terraform state, the reverse DMS task is described but not provisioned, and TLS mode require may not verify the server certificate chain.

Cost and teardown

Roughly USD 0.20 to 0.25 per hour during a rehearsal (a small DMS instance and database, two small Fargate tasks, a load balancer and a NAT gateway), about USD 1.20 to 1.50 for six hours, and about USD 5 to 6 a day if forgotten. A real VPN connection or an EC2-hosted SQL Server would add to this and can dominate it, so rehearse against a container on your own machine. Prices are list-price estimates dated 2026-11-18, not re-fetched from the pricing pages ⚠ VERIFY.

Teardown checklist

Stop the DMS task, run terraform destroy, delete what you created by hand (the source secret, the ported service stack, the S3 bucket after emptying it, manual snapshots), then run the tag query for Project=cea-lab and Lab=p6-legacy-dotnet-migration. It should print an empty list. A DMS replication instance bills hourly whether or not a task runs. The repository's docs/cost-and-teardown.md has the ordered commands.

Acceptance criteria

  • The 31 tests pass; the gate returns GO on the clean files and NO-GO on the drifted files.
  • The assessment report regenerates identically from the inventory, and you wrote your agreement or disagreement for every row.
  • A rehearsal full load plus CDC reached ongoing replication, and two consecutive reconciliations were clean after the freeze.
  • Both rollback variants were rehearsed and timed, and the point of no return is derived from those times.
  • The gate returned NO-GO for each of several deliberately broken inputs.
  • Teardown is done and the tag query returned an empty list.

Portfolio-ready checklist

The full list is projects/p6-legacy-dotnet-migration/checklist.md. The essentials:

  • Four ADRs, each with the rejected alternatives and why.
  • An assessment table you can defend row by row, including what you decided not to migrate.
  • Evidence you collected: reconciliation output, gate reports, rehearsal timings, the rollback times.
  • A clear statement of what is tested code (classifier, reconciler, gate) and what is design only (the port).
  • Extensions: port a real sample service with golden-file tests, run the reconciler against a real SQL Server and PostgreSQL pair, provision the reverse DMS task, add a parallel-run diff of read requests.

Exercises

🟢 Guided. Copy data/gate-inputs.json, change the rollback rehearsal date to 30 days before the window, and predict which check fails. Run the gate and check your prediction.

🟡 Challenge. Add a table to the source statistics that has a currency column stored as text with trailing spaces. Describe what comparison the reconciler needs so the trailing spaces do not hide a real difference, and write the failing test first.

🔴 Live problem. Ticket MIG-311: "After cut-over the nightly interest figures differ from the old system by a penny on about one account in two thousand. Row counts and totals reconcile." Name three causes (think about decimal precision and rounding mode, date and time zone semantics, and collation) and the golden-file test that would have caught each.

Interview questions

  1. Walk me through migrating a SQL Server database with no more than 30 minutes of downtime.
  2. How do you know the data is identical after the migration, and why is the DMS task status not an answer?
  3. When do you choose rehost over refactor?
  4. What is your rollback plan, and when does it stop being possible?
  5. Why is a percentage-based canary the wrong cut-over for a single-writer ledger?

Key takeaways

  • A migration is a decision process with evidence, not a copy job.
  • DMS moves data; it does not prove the data is the same and it is not your rollback.
  • A gate that can say No-Go, and a rollback you have timed, are what make a cut-over safe.
  • The point of no return is a clock time chosen from a measured reverse path.
  • Decide what not to migrate: retire and retain are real strategies.

Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page