How to migrate from Heroku to Modelence

Move a Heroku app, its Postgres and Redis and its config vars to Modelence, which runs them on AWS in the region you choose. Your coding agent turns the Procfile into one config file.

Last updatedNovember 2026

Modelence keeps the parts of Heroku people like, a few lines of config and a deploy command, and runs your app and its databases on AWS in any of 17 regions, with the Modelence team operating it around the clock. Moving mostly means turning your Procfile and add-ons into one config file, which your coding agent writes for you, while you sign in, paste your secrets and switch the domain.

Many teams are planning the move now because Heroku has asked for work on their side anyway. Heroku moved to sustaining engineering in February 2026, the Heroku-22 stack reaches end of life on April 30, 2027, and Postgres 15 databases get forced upgrades from January 28, 2027. If you have to rebuild on a new stack and upgrade your database either way, you can do it on Modelence. To weigh Modelence against the other places a Heroku app can go, see our Heroku alternatives comparison.

Paste this into your coding agent to start

Where each part of your Heroku app goes

The processes in your Procfile and the add-ons attached to the app become entries in one config file.

On HerokuOn Modelence
ProcfileEach process type, such as web, worker or clock, becomes a service in modelence.config.json, and they deploy together. web goes first, since it serves your domain.
BuildpacksNode.js services build with the install and build commands in the config file. Ruby, Python, PHP, Go and Java services build from a Dockerfile. Rails apps created since 7.1 already have one, and your coding agent writes one for anything else.
Dynos and formationEach dyno size maps to a container size (see the table below), and the number of dynos you set with heroku ps:scale becomes the container count in the dashboard.
Release phaseRun your release command, usually database migrations, against the new database before each deploy, from your machine or your CI.
Config varsThe config file declares the variables the app needs, and the deploy asks you for any value that is missing. Secrets are stored encrypted, and every view of one in the dashboard is logged.
Heroku PostgresCreated in your app's region on the first deploy, with plans from 1 GB to 16 GB of RAM. The data moves with pg_dump and pg_restore.
Heroku Key-Value StoreRedis is created in your app’s region on the first deploy, with plans from 250 MB to 5 GB. A Redis that only holds a cache can start empty.
MongoDB add-onsMongoDB is created in your app's region, its connection string reaches the app as MONGODB_URI, and the data moves with mongodump and mongorestore.
Other add-onsEmail, search, error tracking and storage services keep working as they are. Add their keys to the app as secrets.
Logging add-onsLogs are collected from your app's output with nothing to set up. Traces and metrics need one telemetry entry in the config file.
Heroku SchedulerJobs run on a timer inside a small scheduler service, so you can give them exact schedules instead of every 10 minutes, every hour or every day.
Pipelines and review appsEach app has a production environment and sandbox environments for staging or testing, each with its own variables and databases.
Regions and Private SpacesPick any of 17 AWS regions across the Americas, Europe and Asia Pacific, and the app and its databases are created there together.
Custom domainsAdd your domain to the app and update the DNS record. Domains are unlimited on paid plans, with TLS certificates issued for you.

From a Procfile to the config file

Your coding agent writes modelence.config.json at the root of the repository, with one entry for each process and database. A typical Rails app on Heroku has a Procfile like this:

web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq
release: bundle exec rails db:migrate

On Modelence, web and worker become two services built from the same Dockerfile, and the worker gets its own start command. Postgres and Redis sit next to them in the same file, and env hands their connection strings to the app under the names it already reads:

{
  "$schema": "https://cloud.modelence.com/schema/modelence.config.json?version=1",
  "resources": {
    "web": {
      "type": "service",
      "dockerfile": "Dockerfile"
    },
    "worker": {
      "type": "service",
      "dockerfile": "Dockerfile",
      "start": { "commands": ["bundle exec sidekiq"] },
      "healthCheck": { "type": "none" },
      "rollout": "recreate"
    },
    "main-db": { "type": "postgres", "plan": "postgres-2gb" },
    "cache": { "type": "redis" }
  },
  "env": {
    "DATABASE_URL": { "type": "resource", "resource": "main-db", "output": "url" },
    "REDIS_URL": { "type": "resource", "resource": "cache", "output": "url" },
    "RAILS_MASTER_KEY": { "type": "secret" }
  }
}

The worker listens on no port, so it has no health check, and "rollout": "recreate" stops the old worker before the new one starts, so a job is never picked up by two versions at once. A Django app with Celery or a Node.js app with BullMQ looks the same with its own start commands. The release line has no entry, because the migrations run before the deploy (step 3 below). See how deploying from one config file works.

Choosing container sizes

Start from the memory your dynos have today, then adjust after a few days of real traffic in the dashboard.

Heroku dynoMemoryModelence containervCPU and memory
Basic, Standard-1X512 MBMicro0.25 vCPU, 0.5 GB
Standard-2X1 GBSmall0.5 vCPU, 1 GB
Performance-M2.5 GBMedium Plus1 vCPU, 4 GB
Performance-L14 GBX-Large Plus4 vCPU, 16 GB

Moving your app

Your coding agent does most of the setup, and you step in to sign in, add secrets and copy the database.

1. Give your coding agent the deploy prompt

Open the project in your coding agent and paste the prompt below. The agent reads the Modelence deploy guide, works out how each process builds from your Procfile, Dockerfile, package.json or Gemfile, and goes through the next steps with you.

Paste this into your coding agent

2. List your config vars and add-ons, and rotate your keys

Print everything the app uses with the Heroku CLI:

heroku config --shell -a your-app
heroku addons -a your-app
heroku ps -a your-app

heroku addons shows the databases and services to recreate or keep, and heroku ps shows how many dynos of each size you run. Moving is a good time to rotate API keys and passwords, so issue new ones and give Modelence the new values. You can skip the variables that add-ons set themselves, such as DATABASE_URL and REDIS_URL, since the new databases come with their own.

3. The agent writes the config file and deploys

It declares the services, their databases and the variables they need in modelence.config.json, checks that each service builds and starts locally, and runs the deploy. Your browser opens so you can sign in, pick the app and environment, and paste in the values the deploy asks for. The first deploy creates the databases, so run your release command against the new one before you send it traffic:

DATABASE_URL="<new database URL>" bundle exec rails db:migrate

The connection string is in the environment's variables in the dashboard. From then on, run migrations the same way before each deploy, or as a step in your CI before it deploys.

4. Do a test run of the database copy

The data moves as a backup and restore while the Heroku app is in maintenance mode, so do a test run first to know how long that window will be. Capture a backup, download it and restore it into the new database:

heroku pg:backups:capture -a your-app
curl -o latest.dump "$(heroku pg:backups:url -a your-app)"
pg_restore --verbose --clean --if-exists --no-acl --no-owner \
  -d "<new database URL>" latest.dump

Time the restore and click through the app on its Modelence URL against the copied data. For a database of a few gigabytes the whole copy usually takes minutes. If your database is on Heroku Postgres Advanced, you can instead replicate it with logical replication while the Heroku app keeps serving.

5. Switch over and move your domain

Lower the TTL on your DNS record a day ahead. When you are ready, put the Heroku app in maintenance mode so nothing writes to the database. If the app uses Redis for Sidekiq, Celery or another queue, let the Heroku workers finish what is queued, then stop them:

heroku maintenance:on -a your-app
heroku ps:scale worker=0 -a your-app

Then capture a fresh backup and restore it into the new database with the same commands as in the test run. Once the app looks right on its Modelence URL, add your domain to the Modelence app and point the DNS record at the target the dashboard shows, in place of the herokudns.com one. When traffic has moved over, delete the Heroku app along with its add-ons and any tokens it held.

On AWS, in the region you choose

Your app and its databases run together in the AWS region you pick, on AWS Fargate across two availability zones, with failover and encryption set up from the first deploy. See how Modelence runs your app on AWS.

Starter+Pro+

Americas

  • Oregonus-west-2
  • N. Californiaus-west-1
  • Ohious-east-2
  • N. Virginiaus-east-1
  • Montrealca-central-1
  • São Paulosa-east-1

Europe

  • Irelandeu-west-1
  • Londoneu-west-2
  • Pariseu-west-3
  • Frankfurteu-central-1
  • Stockholmeu-north-1

Asia Pacific

  • Mumbaiap-south-1
  • Singaporeap-southeast-1
  • Seoulap-northeast-2
  • Osakaap-northeast-3
  • Tokyoap-northeast-1
  • Sydneyap-southeast-2

Frequently asked questions (FAQs)

Does Modelence run on AWS?

Yes. Every app runs on AWS Fargate across two availability zones, in the region you pick on the first deploy, and its databases are created in the same region. You can choose from 17 AWS regions across the Americas, Europe and Asia Pacific.

Will my Rails, Django or Laravel app work?

Yes. Any app that runs in a container can move, whatever language it is written in. Services with a Dockerfile build from it, and your coding agent writes one for apps that relied on a buildpack. Rails apps created since 7.1 already include a production Dockerfile.

What happens to my Sidekiq or Celery workers?

Each worker becomes its own service in the config file, next to the web service, and reads the same Redis and database variables. It deploys with the rest of the app, and you set how many containers it runs in the dashboard, the same way you scaled worker dynos.

How do I replace Heroku Scheduler?

Add a small scheduler service that runs your jobs on a timer, with a library such as whenever, rufus-scheduler, Celery beat or node-cron, and keep it on one container so each job runs once. Since you write the schedule yourself, a job can run at 2:15 every night or every five minutes.

How long will my app be down?

Only while the final backup is captured and restored, which your test run tells you in advance. For most apps that is a few minutes, and the maintenance page stays up on your domain throughout. Apps on Heroku Postgres Advanced can replicate the data first and switch with almost no pause.

How does the cost compare?

Heroku prices each dyno by the month, while Modelence bills each container and database by the hour based on its size, at AWS rates with no markup. Each paid plan includes its price as usage, so the bill stays at the plan price unless your apps run more than it covers, and there is no charge per seat. Modelence Starter is $20 a month with $20 of usage included.

Can Claude Code or Cursor do the migration for me?

Yes. Open the project in Claude Code, Cursor, Codex or another coding agent and paste the prompt from the first step. The agent reads the Modelence deploy instructions, turns your Procfile into the config file, writes a Dockerfile if you need one, and asks you for the secrets. Copying the data and switching the domain follow the steps above.

Are my databases backed up?

Yes. Production databases are backed up automatically at least every six hours, with nothing to turn on, and the Modelence team restores a backup for you when you ask. Their connection strings are in your app’s variables, so you can also take your own dump with the standard tools at any time.

Move your app off Heroku

Start on the Free plan and keep Heroku running until you switch the domain.

Or paste this into your coding agent