Skip to content

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 ​

HerokuZenavo
AppA project on one server
web process in the ProcfileA service built from the repository, with an HTTP port
worker and other processesOne more service per process from the same repository, with that command and no HTTP port
Buildpackszbpack, or your Dockerfile
release phaseA command run before the app starts, in the start command
Config varsEnvironment variables
Heroku Postgres, Heroku RedisDatabase services in the project
Dynos and scalingReplicas and resource limits
Automated Certificate ManagementAutomatic Let's Encrypt certificates
Pipelines and review appsNo equivalent: clone the project for staging
Heroku SchedulerNo scheduled jobs yet: run a worker service with a scheduler in the app

1. Deploy the app ​

  1. Add a server and create a project.
  2. Add Service → GitHub, pick the repository and branch, and check the Build Plan Preview.
  3. Set the start command if zbpack's guess differs from the web: line of your Procfile: ZBPACK_START_COMMAND under Settings → Build → zbpack options, or Startup Command under Settings (Service Settings). Put a release: command in front of it, such as sh -c "bin/rails db:migrate && bin/rails server -b 0.0.0.0".
  4. 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:

sh
heroku config --shell -a my-app > heroku.env
zenavo env set --file heroku.env -s web

Leave 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:

sh
pg_dump --no-owner --no-acl "$(heroku config:get DATABASE_URL -a my-app)" | gzip > heroku.sql.gz

Upload 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.

Not affiliated with Zeabur.