Multi-environment cloud migration for a multi-tenant SaaS platform
Migrated a multi-tenant SaaS platform's three environments off legacy, manually-provisioned VMs to a modern cloud setup, diagnosing a database driver incompatibility along the way that was blocking every newly-provisioned environment.
- MySQL
- PHP
- Server provisioning/orchestration
- Object storage
- Managed database
Context
A B2B SaaS client running a multi-tenant architecture (one database schema per tenant, plus a central control schema) across three environments — development, staging, and production — on legacy VM infrastructure that had been provisioned and maintained mostly by hand for years. The goal: migrate all three environments to a different cloud provider with a repeatable, documented process, without interrupting active tenants.
Challenge
The initial audit surfaced both infrastructure and application debt: environment drift between dev, staging, and production; fully manual provisioning with no scripts or runbooks; and a database authentication-plugin incompatibility between the newer MySQL default and the legacy PHP/PDO driver that broke every freshly-provisioned environment until fixed by hand.
What I did
- Audited all three environments end-to-end — resources, services, databases, environment variables — and mapped the legacy setup against the new cloud target, including database and runtime tuning parameters.
- Diagnosed a MySQL authentication-plugin mismatch as the root cause of connection failures on every new environment, and made explicit user-recreation with the legacy plugin a mandatory step in the runbook.
- Migrated staging first, then dev, then production — validating each step before moving to the next — provisioning fixed IPs, security groups, and reverse-proxy SSL from scratch for each environment.
- Ran a second optimization phase: decoupled file storage and the database from the application instances, moving to managed equivalents (object storage + database-as-a-service), shrinking compute and lowering monthly cost.
Stack
MySQL (multi-tenant, schema-per-tenant), legacy PHP application, in-memory queue/cache, server provisioning/orchestration tooling, IaaS-to-IaaS/PaaS cloud migration with a managed-services optimization phase.
Outcome
Migrated all three environments with zero tenant data loss, fixed IPs, working SSL, and a documented, repeatable deploy runbook. The optimization phase that followed cut monthly infrastructure cost by decoupling storage and database from compute, with a payback estimated under two months.