{"catalogRevision":"cat_726f873af6f566cc","recipeId":"page:migrate:heroku-postgres:multi-tenant-relational-data","recipeRevision":"r1","canonicalPath":"/migrate/heroku-postgres/multi-tenant-relational-data","label":"Migrate Heroku Postgres: Multi-tenant relational data","title":"How to move multi-tenant relational data from Heroku Postgres to Ample","family":"Migration guide","summary":"Move PostgreSQL data from Heroku Postgres to Ample, one component at a time. Destination verified on Ample: a tenant column on every row and query, with a cross-tenant read returning nothing (tenant_isolation=ok). Source procedure: Take a logical backup with `heroku pg:backups:capture` and download it, or `pg_dump -Fc` against the credentials from `heroku pg:credentials:url`. Move separately: followers, forks, rollback (PITR) and dataclips are Heroku Postgres features; on Ample back up with `pg_dump`. Cutover: Put the app in maintenance mode with the user's go-ahead, take the final backup, restore, validate, redeploy with the managed DATABASE_URL, keep the Heroku database until confirmed. Rollback: keep the source untouched until you confirm; nothing at the source is changed or deleted by this guide.","representativeQueries":["Migrate Heroku Postgres: Multi-tenant relational data","Where can I host Multi-tenant relational data?","I need a component-scoped export/import or reconfiguration procedure for Multi-tenant relational data, with compatibility checks, verification and rollback."],"breadcrumbIds":["discovery","migration","migration:postgres-sources","migration:heroku-postgres","page:migrate:heroku-postgres:multi-tenant-relational-data"],"breadcrumbs":[{"id":"discovery","label":"Agent hosting discovery","canonicalPath":"/discover/discovery","kind":"root"},{"id":"migration","label":"Migration sources by component","canonicalPath":"/discover/migration","kind":"facet"},{"id":"migration:postgres-sources","label":"Postgres sources","canonicalPath":"/discover/migration/postgres-sources","kind":"group"},{"id":"migration:heroku-postgres","label":"Heroku Postgres","canonicalPath":"/discover/migration/heroku-postgres","kind":"atom"},{"id":"page:migrate:heroku-postgres:multi-tenant-relational-data","label":"Migrate Heroku Postgres: Multi-tenant relational data","canonicalPath":"/migrate/heroku-postgres/multi-tenant-relational-data","kind":"recipe"}],"parentIds":["migration:heroku-postgres","pattern:multi-tenant-relational-data","intent:migrate-postgres"],"parents":[{"id":"migration:heroku-postgres","label":"Heroku Postgres","canonicalPath":"/discover/migration/heroku-postgres","kind":"atom"},{"id":"pattern:multi-tenant-relational-data","label":"Multi-tenant relational data","canonicalPath":"/discover/pattern/multi-tenant-relational-data","kind":"atom"},{"id":"intent:migrate-postgres","label":"Migrate Postgres","canonicalPath":"/discover/intent/migrate-postgres","kind":"atom"}],"resourceRequirements":["primitive:postgres"],"infrastructureRequirements":[{"primitiveId":"primitive:postgres","label":"Postgres","canonicalPath":"/discover/primitive/postgres","status":"verified","summary":"Managed PostgreSQL 16 with pgvector runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied."}],"workload":"Multi-tenant relational data","migrationSource":"Heroku Postgres","releaseStatus":"published","supportStatus":"verified","executionStatus":"unbound","docsOnly":true,"prerequisites":["Authorized access to the Heroku Postgres source and its export tooling","An inventory of every component in scope and out of scope","A validated backup or copy before any cutover","An Ample account token with servers:write, databases:read"],"testedConfiguration":{"template":"node-22","runtime":"node","size":"s-1vcpu-1gb","install":"npm install","build":"npm run build --if-present","start":"npm run start"},"inputSchema":null,"outputSchema":null,"workflowSteps":[{"title":"Inventory the source","body":"List what Heroku Postgres provides beyond the component you are moving. Plan these separately: followers, forks, rollback (PITR) and dataclips are Heroku Postgres features; on Ample back up with `pg_dump`."},{"title":"Source step 1","body":"Take a logical backup with `heroku pg:backups:capture` and download it, or `pg_dump -Fc` against the credentials from `heroku pg:credentials:url`"},{"title":"Source step 2","body":"Check the Postgres major version and extensions against the managed engine (PostgreSQL 16)"},{"title":"Source step 3","body":"Restore into a scratch managed database first and compare row counts"},{"title":"Provision and restore","body":"Deploy the app once so a managed PostgreSQL 16 database exists (or create one with `ample database create --engine postgres`), then restore the dump with pg_restore using its connection string; keep migrations idempotent.","command":"ample database create --name <db-name> --engine postgres"},{"title":"Validate before cutover","body":"Run the app's own checks and, for data, compare counts and checksums; the example checks are the pattern self-tests (/p/multi-tenant-relational-data)."},{"title":"Cut over","body":"Put the app in maintenance mode with the user's go-ahead, take the final backup, restore, validate, redeploy with the managed DATABASE_URL, keep the Heroku database until confirmed."},{"title":"Rollback","body":"Point DNS or configuration back to the source. The source was never modified; deletion is a separate, user-executed step after validation."}],"examples":[{"title":"Express pattern fixture (destination)","description":"Verified destination basis: multi-tenant relational data.","sourceRef":"tests/deploy-canaries/express-patterns"}],"successChecks":[{"description":"destination app responds on its public URL","kind":"http_get","path":"/","expect":"ample canary express patterns"},{"description":"multi-tenant-relational-data check from the destination example","kind":"http_get","path":"/p/multi-tenant-relational-data","expect":"see the pattern fixture checks"},{"description":"data or object counts and checksums match the source","kind":"manual","expect":"operator comparison before cutover"}],"limitations":["A step-by-step guide: each stage is an ordinary `ample deploy`, `ample database` or `ample bucket` command you run.","The destination side was verified on Ample with the pattern fixture; the source-side steps use Heroku Postgres's standard tooling.","Plan separately: followers, forks, rollback (PITR) and dataclips are Heroku Postgres features; on Ample back up with `pg_dump`.","Verified on the node-22 template at s-1vcpu-1gb.","Managed PostgreSQL 16 with pgvector. Back up and restore with pg_dump and pg_restore."],"costEstimate":{"currency":"USD","monthlyAmount":10.0,"authoritative":true,"basis":"size prices from pricing.toml (loaded by the API) at build revision 3a3dfe06151688a20d397caac2aa66e562c23eb0","components":[{"name":"app server","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0},{"name":"managed PostgreSQL database","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0}],"note":"Upper-bound monthly price of the tested sizes at the destination."},"evidenceSummary":[{"kind":"canary_run","summary":"Destination side verified: the Express pattern fixture deployed on Ample (npm install, npm run build --if-present, npm run start on the node-22 template) and its checks passed (a tenant column on every row and query, with a cross-tenant read returning nothing (tenant_isolation=ok)). The source-side export from Heroku Postgres uses the vendor's standard tooling.","observedAt":"2026-11-05T22:38:23Z","implementationRevision":"da3e37255e5a","expiresAt":"2027-05-04T22:38:23Z","scope":{"checks":["/p/multi-tenant-relational-data"],"destinationOnly":true,"template":"node-22"}}],"lastVerifiedAt":"2026-11-05T22:38:23Z","mcpBinding":null,"unknowns":[],"formats":{"html":"https://ample.computer/migrate/heroku-postgres/multi-tenant-relational-data","markdown":"https://ample.computer/migrate/heroku-postgres/multi-tenant-relational-data.md","json":"https://api.ample.computer/v1/catalog/recipes/page%3Amigrate%3Aheroku-postgres%3Amulti-tenant-relational-data"},"nextActions":[{"actionId":"browse-catalog","label":"Browse the catalog index","operationId":"catalog_index","method":"GET","relativePath":"/v1/catalog","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"search-recipes","label":"Search published recipes by intent, stack and constraints","operationId":"search_recipes","method":"POST","relativePath":"/v1/catalog/search","origin":"api","parameters":{"body":{"limit":5,"query":"Migrate Heroku Postgres: Multi-tenant relational data"}},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"plan:page:migrate:heroku-postgres:multi-tenant-relational-data","label":"Prepare a side-effect-free deployment plan for an authorized project","operationId":"plan_deployment","method":"POST","relativePath":"/v1/catalog/plan","origin":"api","parameters":{"body":{"inputs":{},"projectId":"<workspace or server id you own>","recipeId":"page:migrate:heroku-postgres:multi-tenant-relational-data","recipeRevision":"r1"}},"requiresAuthentication":true,"requiresApproval":false},{"actionId":"auth-setup","label":"Read the existing agent authentication setup","operationId":"existing_auth_setup","method":"GET","relativePath":"/mcp/setup","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:migration:heroku-postgres","label":"Browse Heroku Postgres","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/migration%3Aheroku-postgres","origin":"api","parameters":{"nodeId":"migration:heroku-postgres"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:pattern:multi-tenant-relational-data","label":"Browse Multi-tenant relational data","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/pattern%3Amulti-tenant-relational-data","origin":"api","parameters":{"nodeId":"pattern:multi-tenant-relational-data"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:intent:migrate-postgres","label":"Browse Migrate Postgres","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/intent%3Amigrate-postgres","origin":"api","parameters":{"nodeId":"intent:migrate-postgres"},"requiresAuthentication":false,"requiresApproval":false}]}