Migrating from Heroku to Widemesh

This guide covers the steps required to migrate an existing Heroku app to Widemesh.

After a successful migration from Heroku to Widemesh you can expect to:

  • No longer rely on Dyno types to host your app, your app will be hosted in containers deployed on servers provisioned by Widemesh out of your own AWS or DigitalOcean account.
  • Continue using most Heroku Add-ons that inject configurations via configuration variables.
  • Continue deploying apps the same way as before, regardless of the Heroku stack.

Deploying the source code

It’s crucial you determine the configuration of your Heroku app first, so it matches when deployed on Widemesh.

Widemesh supports the only two ways to deploy Heroku apps: Buildpacks and Docker Containers.

Note: The rest of this guide assumes you have installed and correctly configured the Heroku CLI, git, and heroku git:remote for the source code in the current directory.

To determine what stack is your Heroku app using you can use:

heroku stack

The outputs show a list of Heroku stacks with a star in the one you Heroku app currently uses:

=== Available Stacks
* heroku-18

In this case, the star is at heroku-18, that means you could deploy this app on Widemesh like any other:

mesh deploy

If the star is at container it means you must deploy your widemesh app with the following command:

mesh deploy --dockerfile

This command updates the Widemesh stack of your app to use your Dockerfile before building and deploying your app.

See the docs of mesh deploy for more information.

Warning: When the star is either at cedar-14 or heroku-16, we recommend you first upgrade your stack to heroku-18 in Heroku, test your app stability, and only then continue with the rest of this guide to complete your migration to Widemesh.

Importing Configurations

Both Heroku and Widemesh provide configuration variables to your app via environment variables; you can quickly import your Heroku configuration variables with the following command:

heroku config -j | mesh config import --json-file=-

This exports all the configurations from Heroku as json (-j) and get piped to Widemesh via stdin( --json-file=-).

See the focs of mesh config import for more information and examples.