ActiveManage Docs ← Back to activemanage.co.uk

Migrating Between Modes

You can change a tenant's mode without losing data, but it's not instant. This article walks through migrating a tenant between Shared and Separate database modes in either direction.

Step-by-step flow: 1. Mark tenant 'migrating' 2. Snapshot source rows 3. Create target DB 4. Bulk copy 5. Validate counts 6. Swap connection 7. Verify and unfreeze writes

Shared → Separate

  1. Schedule: Pick a low-traffic window for the tenant. Set the tenant to “read-only” in the directory.
  2. Provision: Create a new database (e.g. tenant_123_db) and run schema migrations.
  3. Snapshot: Use the platform's tenant-export tool to extract every row tagged with this tenant's ID.
  4. Load: Import into the new DB. Validate row counts per table.
  5. Switch: Update the tenant's directory entry to point at the new DB. Existing sessions are terminated.
  6. Verify: Log in as a test user, run smoke tests against the new DB.
  7. Cleanup: After 24-48 hours of stability, delete the now-orphaned rows from the shared DB.

Separate → Shared

  1. Schedule: Low-traffic window. Tenant goes read-only.
  2. Export: Dump the tenant's DB.
  3. Import: Insert into shared DB, attaching the tenant ID to every row.
  4. Switch: Update directory; sessions terminated.
  5. Verify: Smoke test as above.
  6. Cleanup: Drop the separate DB once you're confident.

Worked Examples

  • Tenant graduation: A customer outgrew the shared pool and signed up for premium hosting — migrate them to a dedicated DB during their off-hours.
  • Tenant consolidation: Two small tenants on separate DBs cost more to maintain than they're worth — fold them back into shared.
  • Acquisition: Acquired company arrives with their own DB; copy into your shared infrastructure to onboard.
Warning: Never skip the row-count verification step. A silent partial copy is the worst failure mode and is hard to detect later. Compare per-table counts and total record counts before declaring success.