Migrate from Heroku
Zenavo builds and runs a Heroku app with few changes: it builds from Git with zbpack or your Dockerfile instead of buildpacks, and sets PORT the same way. Your app then runs on a server you own.
How Heroku maps to Zenavo
| Heroku | Zenavo |
|---|---|
| App | A project on one server |
web process in the Procfile | A service built from the repository, with an HTTP port |
worker and other processes | One more service per process from the same repository, with that command and no HTTP port |
| Buildpacks | zbpack, or your Dockerfile |
release phase | A command run before the app starts, in the start command |
| Config vars | Environment variables |
| Heroku Postgres, Heroku Redis | Database services in the project |
| Dynos and scaling | Replicas and resource limits |
| Automated Certificate Management | Automatic Let's Encrypt certificates |
| Pipelines and review apps | No equivalent: clone the project for staging |
| Heroku Scheduler | No scheduled jobs yet: run a worker service with a scheduler in the app |
1. Deploy the app
- Add a server and create a project.
- Add Service → GitHub, pick the repository and branch, and check the Build Plan Preview.
- Set the start command if zbpack's guess differs from the
web:line of yourProcfile:ZBPACK_START_COMMANDunder Settings → Build → zbpack options, or Startup Command under Settings (Service Settings). Put arelease:command in front of it, such assh -c "bin/rails db:migrate && bin/rails server -b 0.0.0.0". - For each other process type, add the repository again with that process's command and no HTTP port.
Apps that already listen on $PORT need no change; listen on 0.0.0.0 too.
2. Copy the variables
Export the config vars and paste them under the service's Variable tab → Edit Raw Variables, or set them with the CLI:
heroku config --shell -a my-app > heroku.env
zenavo env set --file heroku.env -s webLeave out DATABASE_URL, REDIS_URL and other add-on variables: point them at the new database services instead, such as DATABASE_URL=${POSTGRESQL_CONNECTION_STRING}. Delete heroku.env afterwards; it holds secrets.
3. Move the database
Add PostgreSQL to the project with the same major version as Heroku's (heroku pg:info shows it). Heroku's own backups use pg_dump's custom format, which Zenavo does not read, so take a plain SQL dump:
pg_dump --no-owner --no-acl "$(heroku config:get DATABASE_URL -a my-app)" | gzip > heroku.sql.gzUpload heroku.sql.gz under the new database's Backup & Restore tab and restore it into the empty database (Uploading a backup). Put the app in maintenance mode first (heroku maintenance:on) so nothing is written after the dump. Uploads are limited to 2 GB.
Heroku Redis is usually a cache: start the new Redis empty.
4. Switch the domain
Bind each domain under the service's Networking tab. Heroku domains use a CNAME to herokudns.com; replace it with an A record to the server's IP address. The certificate is issued once the record resolves (Domains & HTTPS). Keep the Heroku app until the new one has served traffic for a while.