# Migrate from Heroku

> Move a Heroku application to Fransys: the Procfile, config vars, Heroku Postgres, the Scheduler and add-ons.

Source: https://docs.fransys.cloud/en/guides/migrer-depuis-heroku/ Checked against the console on 2026-10-23.

## How things map

| On Heroku | On Fransys |
|---|---|
| a `web` dyno in the Procfile | an **Application** |
| a `worker` dyno | a copy of the service, with a role read by the entrypoint |
| the `release` phase | **Deployment commands** › **Before an update** |
| config vars | **Variables**, by importing a `.env` |
| Heroku Postgres | a **PostgreSQL** database |
| Heroku Redis | a **Redis** database |
| Heroku Scheduler | a **scheduled task** |
| a buildpack | a Dockerfile in your repository |
| the domain | **Add a domain**, then the DNS record |

## 1. The Dockerfile

Fransys builds a Docker image: add a Dockerfile to your repository. See [Deploy Laravel](https://docs.fransys.cloud/en/guides/laravel/) or [Node.js and Next.js](https://docs.fransys.cloud/en/guides/node-nextjs/). Listen on the port of your choice, then set it in **Container port** (Heroku forces `$PORT`, Fransys doesn't).

## 2. The service and its variables

Add the application and connect the CI ([From GitHub or GitLab](https://docs.fransys.cloud/en/projets/github-gitlab/)). Get your config vars:

```sh
heroku config -s -a my-app > heroku.env
```

then import the file into **Variables** (**Multiple variables (.env)** mode). Remove `DATABASE_URL` and `REDIS_URL`: they'll come from the Fransys databases. Protect the secrets.

## 3. The data

Add a PostgreSQL database linked to the application, turn on its **remote access**, then:

```sh
heroku pg:backups:capture -a my-app
curl -o dump.backup "$(heroku pg:backups:url -a my-app)"
pg_restore --no-owner --no-acl -h <host> -p <port> -U <user> -d <database> dump.backup
```

with the Fransys database's credentials. Turn remote access off once the import is done.

## 4. Workers and the scheduler

- Each `worker` dyno: copy the service and give it its role. See [Application](https://docs.fransys.cloud/en/projets/application/#workers-queues-scheduled-tasks).
- Each Scheduler job: a [scheduled task](https://docs.fransys.cloud/en/projets/taches-planifiees/).

## 5. Switch over

Deploy, check the `fransysapp.com` address, then add your domain and change the DNS. Keep the Heroku application read-only while the DNS propagates. See [Domain and HTTPS](https://docs.fransys.cloud/en/projets/domaine-et-https/).
