Migrate from Heroku
Migrating your app from Heroku to Railway 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 Railway, push your code, and migrate your envionment variables.
This guide will step you through the process of migrating a simple web service, using the Railway CLI.
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 Railway CLI is properly linked.
Ensure your CLI is authenticated to your Railway account:
This command will prompt to open a browser to complete authentication. Once authenticated, commands executed by the Railway CLI, will be performed in the context of your Railway account.
Now, let's create a new project:
This command will prompt you to define a name for your service.
Once your project is created, you can push your code into the project and assign a domain.
Push the code into a service in Railway:
At this point, the service is being deployed, but let's give it a domain.
The service we are migrating 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.
Finally, we will import the environment variables from Heroku into Railway.
Let's pop over to our new project in the Railway canvas.:
This will open the project in your browser.
From the project canvas, import the Heroku variables into the service:
- click on the service
- open the command palette using
CMD + Kor
Ctrl + K.
- search for
Import variables from Heroku
- confirm the Heroku service and hit
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 Railway to connect to your Heroku account.
Following this guide, we have successfully migrated a simple web service from Heroku to Railway, including importing variables from Heroku into Railway.
We have completed the migration by pushing our code directly from our local machine into a service in Railway. Once you are comfortable with Railway, you may want to integrate deployments into your development workflow.
For more advanced operations, like migrating your databases from Heroku to Railway, the process will be a bit more involved, but we are happy to help work out a solution!
Edit this file on GitHub