A Shopify app that runs on Heroku usually stores its data in Heroku Postgres. Meridian runs PostgreSQL databases too, so the app keeps its Prisma schema, its migrations and its data: you move the data once, then point the app at Meridian.
The move has four parts: prepare the Meridian app, capture a backup on Heroku, restore it into the Meridian database, then switch traffic.
Before you start
- The app on Meridian uses PostgreSQL as its engine. Add a PostgreSQL database from Hosting → Database. If the app already has a MySQL database from its plan, delete it first, while it is still empty.
- The Prisma
datasource stays provider = "postgresql" with url = env("DATABASE_URL"). Meridian sets DATABASE_URL for the environment.
- The repository is connected and the environment has a release command, usually
npx prisma migrate deploy.
- Extensions are not restored: your app’s role owns its database and schema, but cannot create extensions. If your schema uses one (for example
citext or pg_trgm), contact support before you migrate.
1. Capture a backup on Heroku
Stop writes first, so the backup holds everything. Maintenance mode answers every request with an error page, so plan a quiet window:
The last command prints a signed link to the backup. It works for about an hour. Heroku backups are in PostgreSQL’s custom format, which pg_restore reads.
To keep a copy, download it with heroku pg:backups:download -a <heroku-app>, which saves latest.dump.
2. Restore it into the Meridian database
The Meridian database is private: it is reachable from your hosted app, not from the internet. So the restore runs where the app runs, in the release command, which has the same DATABASE_URL and network as the app.
Add pg_restore to the image. In the Shopify template’s Alpine-based Dockerfile:
Use a client of the same major version as your Heroku database, or newer (heroku pg:info shows the version).
Add this script to the repository as scripts/import-heroku.sh:
Then:
- On the Meridian environment, add a secret
HEROKU_DUMP_URL with the link from step 1, scoped to that environment.
- Set the release command to
sh scripts/import-heroku.sh && npx prisma migrate deploy.
- Deploy. The import runs before the new revision exists, and its output appears in the deploy log.
The restore runs in one transaction: if anything fails, the deploy fails, the database stays empty, and you can fix the cause and deploy again. Your Prisma migration history comes with the data, so prisma migrate deploy applies only migrations newer than the backup. The release command has 15 minutes, which covers most Shopify app databases; for a larger one, contact support.
Once the import has run, delete the HEROKU_DUMP_URL secret, set the release command back to npx prisma migrate deploy, and remove the script and the apk add line at your next change.
Or let support import it
If you would rather not change the Dockerfile, contact support. Download the backup with heroku pg:backups:download and tell us which app and environment it is for: Meridian imports it into that database for you, owned by your app’s role, and confirms when it is done.
3. Check the data
Open Hosting → Database and use the SQL console to compare a few counts with Heroku, for example:
Your app’s own tables come across with their sequences, so new rows continue the ids Heroku used.
4. Switch traffic
Point your Shopify app’s URLs at the Meridian environment’s domain (the default domain or your custom domain), and deploy the configuration with the Shopify CLI. Keep the Heroku app in maintenance mode until the Meridian app answers, then remove the Heroku database when you no longer need it.
Shop sessions live in the Session table you imported, so merchants do not need to reinstall the app. Last modified on November 13, 2026