Migrating from Heroku to StackBlaze
A practical checklist for moving web dynos, Postgres, Redis, and config vars, without a big-bang cutover weekend.
Tom Walsh
Developer Advocate
We talk to teams every week who are outgrowing Heroku pricing, need private networking between services, or want PITR on every database tier without an enterprise contract. Migration does not have to be a freeze-the-company weekend if you stage it correctly.
Concept mapping
| Heroku | StackBlaze |
|---|---|
| App | Web service |
| Worker dyno | Worker service |
| Heroku Scheduler | Cron service in blueprint.yaml |
| Config vars | Environment variables / secrets |
| Heroku Postgres | Managed Postgres resource |
| Heroku Redis | Managed Redis resource |
| Review apps | PR preview environments |
Step 1: Export config and provision StackBlaze
Run heroku config -s -a your-app and save the output. Create a StackBlaze project, connect the same GitHub repo, and recreate variables in the dashboard, use Secret for anything sensitive. Do not commit production secrets to blueprint.yaml.
Step 2: Database migration
For Postgres, take a logical dump from Heroku and restore into StackBlaze Postgres. For large databases, use pg_dump with custom format and parallel restore to cut downtime.
#!/usr/bin/env bash
set -euo pipefail
HEROKU_URL="${HEROKU_DATABASE_URL:?}"
STACKBLAZE_URL="${DATABASE_URL:?}"
pg_dump "$HEROKU_URL" --format=custom --no-owner -f backup.dump
pg_restore --dbname="$STACKBLAZE_URL" --no-owner --jobs=4 backup.dump
echo "Restore complete, run verification queries before cutover"Minimize downtime with a read replica window
If you can tolerate minutes of read-only mode: put Heroku in maintenance, take a final incremental dump or use logical replication for the last mile, restore, verify row counts, then swap DATABASE_URL in your DNS cutover step.
Step 3: Staging parity and smoke tests
Deploy to a staging environment first. Hit health endpoints, run your integration test suite, and verify worker/cron jobs against staging data. StackBlaze PR previews help QA individual branches before merge.
Step 4: Cutover
- Lower DNS TTL on your custom domain 24 hours ahead of time.
- Deploy production on StackBlaze and confirm green health checks.
- Point DNS to StackBlaze (or use a proxy in front during transition).
- Monitor error rate and latency for one hour; keep Heroku app scaled to zero but available for rollback.
- Deprovision Heroku add-ons after 48 hours of stable traffic.
What teams tell us surprised them
- Private .internal hostnames replace public DATABASE_URL calls between services, update connection code if you were routing through the internet.
- Build times are often faster because we cache npm/pip layers keyed on lockfiles.
- Invoice line items map per service, easier to see which microservice drives cost.
We offer migration office hours for teams moving more than five services. Book through support in the dashboard if you want a human to review your blueprint before cutover.
Tom Walsh
Developer Advocate at StackBlaze
Member of the founding team at StackBlaze. Writes about infrastructure, engineering culture, and the systems that keep production running.
More from the blog
How Calico network policies isolate tenants on shared hosting
Shared Kubernetes does not have to mean shared trust boundaries. Calico enforces network isolation, Linkerd provides automatic mTLS between services, and Falco detects runtime threats, three layers that keep tenants separated on shared infrastructure.
Shared platform vs dedicated clusters: control plane isolation and policy-as-code
Policy-as-code on a shared platform gives you guardrails without operational overhead. Dedicated clusters add an isolated control plane, single-tenant nodes, and customer-owned policy boundaries, here is how to choose and what changes under the hood.
Regulatory compliance and data governance on StackBlaze
SOC 2, GDPR, HIPAA-readiness, data residency, encryption, audit logs, and DPAs, a detailed map of how StackBlaze controls align with common regulatory frameworks and what you own vs what the platform certifies.