Docs menu
Moving an app from Heroku
A walkthrough for moving a running Heroku app to Primcloud with zero downtime.
On this page
Before you start#
You'll need a Primcloud account with GitHub connected (the Quickstart walks you through it) and the Heroku CLI, so you can read your config vars.
A few things go by different names here:
| On Heroku | On Primcloud |
|---|---|
| Process type | Pod formation |
| Dyno count | Instances |
| Dyno type | Compute size |
| Config vars | Secrets |
heroku run |
Tasks |
*.herokuapp.com |
*.primcloud.app |
The guide follows one app, hack-the-planet, from start to finish.
1. Bring your Procfile as it is#
You don't need to change it.
release: perl bin/release.pl
web: perl bin/board.pl --port=$PORT
worker: ./bin/queued -d
No Procfile? Most languages start a sensible web process on their own, and your language's page under Language Support says what it runs.
Note
The build ignores an Aptfile. Move those packages into a project.toml, as the Customizing the build page for your language under Language Support shows.
2. Pull up your config vars#
heroku config -a hack-the-planet
Leave PORT out, since Primcloud sets it for you. Add-on vars come over like any other, as long as the add-on accepts connections from outside Heroku.
3. Import your repo#
From your applications list, hit Import Git Repository. Pick the repo, then on the Configure step choose your branch and region.
That Configure step also has a Secrets list. Add your config vars there and they're saved before the first build.
Check the commit and hit Import. The first deploy starts right away.
Once Rollout shows Complete, open your app at hack-the-planet-production.primcloud.app. Forgot a secret? Add it under Settings → Secrets and save. Once your app is running, saving redeploys it with the new value, no rebuild needed. If the first deploy failed, save the secret, then hit Redeploy on that deployment.
4. Turn your workers on#
Important
After the first deploy, only web is running. Every other process starts at 0 instances, so your workers are off until you scale them up.
Open Pod Formations on your app's dashboard and expand a formation. Instances is your dyno count. Formation Size is your dyno type: the memory and CPU each instance gets.
Everything starts on Standard 1x, our smallest size. Memory is a hard limit, so pick a size with at least as much memory as your app uses on Heroku. Scaling formations has the details.
5. Swap heroku run for tasks#
Anything you'd run with heroku run becomes a task. It runs your command on a fresh instance of your current build, with the same secrets as your app, and streams the output while it runs.
A task isn't an interactive shell. Give it a command and it runs until that command exits.
6. Move your domain#
- Add your domain in your app's Settings. We'll show you the two DNS records to add, a CNAME and a TXT record.
- Add the TXT record at your DNS provider.
- Change your CNAME from Heroku to the target we showed you. For a root domain like
example.com, use an ALIAS, ANAME or flattened CNAME; DNS setup explains why. - Wait for the domain to show Success. We keep checking DNS for up to 72 hours, and once it verifies, your app is served over HTTPS.
- Make it your primary domain. Your
primcloud.appURL then redirects to it.
7. Switch Heroku off#
Delete your Heroku app:
heroku apps:destroy -a hack-the-planet