SaaS Migration to Multi-Tenant: Plan the Cutover

A SaaS migration to multi-tenant needs a dependency inventory, a tested tenant mapping, a cutover rehearsal and a rollback gate. Plan each step here.

10 min read
Bundles of blue network cables plugged into the ports of a rack switch, with green status lights lit.

A SaaS migration to multi-tenant moves customers who each run on their own copy of the product onto one shared system. It works when every customer's data, settings and integrations arrive intact and the team can reverse a batch if a check fails. Product owners and development leads on Australian SaaS teams get a staged plan here: inventory dependencies, test the tenant mapping, rehearse the cutover and set a rollback gate.

It assumes a separate stack already exists for each customer. Teams still choosing a tenancy design should start with our guide to isolation choices in multi-tenant SaaS.

Key Takeaways

  • List everything each customer copy relies on, from scheduled jobs to domain names, before writing migration code.
  • Map each customer copy to one tenant record, and name every exception.
  • Move customers in batches, starting with an internal tenant.
  • Rehearse the cutover and the rollback on production-sized data, and time both.
  • Close a batch only when counts, comparisons, isolation tests and integration checks pass.

What Does a SaaS Migration to Multi-Tenant Change?

A SaaS migration to multi-tenant changes who shares what. Each customer copy once had its own release timing; afterwards one release serves every migrated tenant, and the tenant identifier keeps customers apart. Microsoft's tenancy guidance notes that a single shared system simplifies maintenance but is often riskier, because a change can affect the whole customer base.

AWS's SaaS architecture whitepaper, which AWS marks as historical reference, says shared services such as identity, onboarding and tenant-aware operations can go in first, even while the application still runs as a separate silo for each customer.

The same page lists tiers and pricing among the business questions that shape the technical answers, so settle plan structure first with our guide to SaaS pricing models: an enterprise tier may stay dedicated while smaller plans move. Our guide to SaaS MVP development advises enforcing customer separation in code from the first release; this article covers products already running a copy per customer.

Decision Inputs to Settle Before Any Customer Moves

Three inputs shape the plan, and each needs an owner.

  • Tenant definition: A customer with several divisions, regions or separate development and production instances may need more than one tenant, as Microsoft's tenancy models guidance notes. List those exceptions early.
  • Contract terms: Check data location, dedicated-infrastructure promises and change notice. Microsoft's tenant life cycle guidance lists data residency among the things to settle when onboarding each tenant, and our guide to SaaS data residency for Australian customers covers it.
  • Downtime tolerance: Microsoft says to consider whether moving a tenant might cause downtime and to make sure tenants understand the risk. Agree a freeze window per batch.

Build the Dependency Inventory for Each Customer Copy

A dependency inventory lists everything a customer copy needs to behave the same after the move. Microsoft's tenancy guidance says that when tenants move between hosting models, the plan should preserve the tenant's logical identity and cover data, configuration, identities, domain names, entitlements and audit history.

  • Data stores: Database, files, search indexes, caches and queues. If every copy numbers records from 1, the same ID exists in many copies, so keys need the tenant or a translation table.
  • Configuration: Per-customer settings, feature flags and any code branch written for one customer.
  • Identity: Accounts, single sign-on connections and API keys, including emails that exist in more than one copy.
  • Integrations: Webhooks, callbacks, scheduled jobs, customer domain names and allow-listed IP addresses.
  • Billing and entitlements: Plan identifiers the product reads to switch features on. Treat billing moves as their own change, as in our guide to subscription migration without billing errors.

Platforms that sit inside daily operations, such as the industry business systems 9Byte builds and maintains, can carry longer lists, because each copy may have grown its own reports and integrations. Give every item an owner and a test.

Test the Tenant Mapping Before Moving Any Data

A tenant mapping records which customer copy becomes which tenant, plan, region and batch. Microsoft says you probably need such a record so requests reach the right infrastructure.

  • Reviewed data: Keep it in version control and fail the run when a copy maps to no tenant or to two.
  • Status: Track not started, backfilled, verified, cut over and rolled back, and let the request router read it.
  • Verified context: The OWASP Multi-Tenant Security Cheat Sheet lists tenant context injection among key risks, so take the tenant from the verified session, never from request input.
  • Migration role: OWASP says to reserve privileged database connections for migrations and authorised admin jobs. Remove that role after the final batch.

A Staged Cutover Sequence That Can Be Reversed

Stripe's engineering team describes a four-step dual writing pattern for online migrations: write to the old and new stores together, move all reads to the new store, move all writes to it, then remove the old data. Stripe used it for subscription records, so treat this sequence as our adaptation and run it one batch of customers at a time.

  1. Start dual writing for an internal tenant. Stripe ramped up slowly while watching operational metrics, then backfilled and re-ran its search for missing records.
  2. Compare reads. Stripe used GitHub's Scientist library to read both stores and alert on any difference.
  3. Switch reads, then writes, inside the freeze window. Stripe wrote to the new store first and archived to the old one; keep that reverse copy running through the rollback window so a revert loses nothing.
  4. Make the old copy read-only and remove it after the gate passes.

On PostgreSQL, check each schema change's lock level in rehearsal: the ALTER TABLE documentation says an ACCESS EXCLUSIVE lock is acquired unless explicitly noted for a subform.

Failure Modes to Rehearse Before Cutover Day

Each failure mode has a signal that shows it early and a control that limits it.

  • Colliding IDs: Two copies share an identifier and the backfill overwrites rows. Signal: per-tenant row counts differ from the source. Control: tenant-scoped keys and a dry run that fails on any collision.
  • Duplicate people: One email exists in two copies and becomes one account reaching both. Microsoft says authorisation should consider both tenant and user identity. Signal: accounts linked to several tenants. Control: review each before merging.
  • Stragglers on the old copy: A job on the old copy still emails customers, or a customer system still posts to the old domain. Signal: old-copy run logs and old-endpoint requests after cutover. Control: disable jobs in the cutover script and keep a counted redirect.
  • Load and lock stalls: A backfill or schema change slows live customers. Signal: rising p95 latency and lock waits in rehearsal. Control: throttle the backfill.
  • Rollback that loses data: Customers write to the new store, then the team reverts to a stale copy. Control: the reverse copy above.

Run the Rehearsal on Production-Sized Data

A rehearsal restores production-sized data for a pilot tenant, runs the full cutover script and times each step. The measured times set the freeze window. Then run the rollback, because an untested rollback is only a hope. Shared backups hold several tenants, and OWASP advises restoring into a separate resource and recovering only the target tenant, so rehearse that path too, with the approach in our backup and recovery guide.

Rollback Gate: A SaaS Migration to Multi-Tenant Checklist

A rollback gate is a go or no-go check run after a batch switches and before its old copies are retired. Write the criteria first; the numbers here are starting points for your own service commitments to replace.

  • Counts: Each migrated tenant's row count in the shared store equals the source, with zero unexplained differences.
  • Comparison: The read comparison shows zero mismatches across an agreed window, for example one full business cycle.
  • Isolation: Cross-tenant access tests pass for every endpoint returning tenant data, and no logged request lacks a verified tenant identifier.
  • Integrations: Each inventory webhook, job and sign-on connection shows one successful event, and the old endpoint receives none.
  • Performance: The p95 latency for migrated tenants stays within an agreed margin of the rehearsal baseline.
  • Rollback: A rehearsed rollback finished inside the freeze window customers were told about.

Any failed criterion means no-go: revert the batch, fix the cause and rerun the rehearsal. Retire a customer copy only after the gate has held through the agreed window.

Related Resources

Answers to Settle Before the First Batch

1. What Is a SaaS Migration to Multi-Tenant?

It is the move of customers from separate per-customer copies of a product onto one shared system, where a tenant identifier keeps each customer's data apart.

2. Should Customers Move All at Once or in Batches?

In batches, starting with an internal tenant. Stripe ramped its migration up gradually while watching operational metrics, because the extra writes load the production database. Batching also limits how many customers one mistake can reach.

3. Does Every Customer Have to Move to Shared Infrastructure?

No. Microsoft notes that some customers can keep dedicated infrastructure, that you can charge more for it and that the codebase must then support both models.

4. How Long Should the Rollback Window Stay Open?

Long enough to see events that only appear on a schedule, such as month-end jobs, reports and renewals. Write the length into the gate and keep the old copy read-only and in step until the gate passes.

Rehearse the Cutover Before Any Customer Moves

A SaaS migration to multi-tenant is safe when every step can be rehearsed, measured and reversed. Finish the inventory, lock the mapping, time the rehearsal and its rollback, and write the gate criteria down. Then move the internal tenant first.

Ready to build what is next?

Talk to our Melbourne engineering team about modernising your systems or shipping your next product.