Treasury|Treasury Docs

Migrate from Heroku

Migrating your app from Heroku to Treasury is very simple. We even support Procfiles out of the box. (Only a single process is supported for now).

All you need to do is create a project in Treasury, push your code, and migrate your environment variables.

This guide will step you through the process of migrating a simple web service, using the Treasury CLI.

Screenshot of Treasury Up

Working directory

In your terminal, ensure your current working directory is the same directory where your service code is located.

This is important so that as you complete the following steps, the Treasury CLI is properly linked.

1. Login to Treasury from the CLI

Ensure your CLI is authenticated to your Treasury account:

This command will prompt to open a browser to complete authentication. Once authenticated, commands executed by the Treasury CLI, will be performed in the context of your Treasury account.

2. Create a new project

Now, let's create a new project:

This command will prompt you to define a name for your service.

3. Deploy the service

Once your project is created, you can push your code into the project and assign a domain.

Push the Code

Push the code into a service in Treasury:

At this point, the service is being deployed, but let's give it a domain.

Assign a domain

The service being migrated is a web service that should be available over the Internet, so let's assign a domain:

Now the service will be available over the Internet via the provided domain.

4. Migrate the environment variables

Finally, import the environment variables from Heroku into Treasury.

Video of importing variables from Heroku

Open the project in Treasury

Let's pop over to your new project in the Treasury canvas.:

This will open the project in your browser.

Add Heroku variables to the service

From the project canvas, import the Heroku variables into the service:

  • click on the service
  • click Variables tab
  • open the command palette using CMD + K or Ctrl + K.
  • search for Import variables from Heroku
  • confirm the Heroku service and hit Enter

Your Heroku variables will be imported into the service, and it will automatically redeploy.

Note: The first time you import variables from Heroku, you will be prompted to Allow Treasury to connect to your Heroku account.

Conclusion

Following this guide, you have successfully migrated a simple web service from Heroku to Treasury, including importing variables from Heroku into Treasury.

The migration is complete by pushing your code directly from your local machine into a service in Treasury. Once you are comfortable with Treasury, you may want to integrate deployments into your development workflow.

For more advanced operations, like migrating your databases from Heroku to Treasury, the process will be a bit more involved, but we are happy to help work out a solution!

Need help?

If you run into any issues, or would like help with your migrations, we would be more than happy to answer your questions on the Treasury Discord or over email at Treasury Discord.