Migrating from Heroku to Patr
Heroku was once the go-to platform for developers looking to quickly deploy their applications to the cloud. However, as the industry has evolved, so have the needs of developers. Heroku's proprietary platform and limited options for customization have left many feeling constrained and frustrated. With the increasing complexity of modern applications and the need for greater flexibility and control, developers are seeking alternatives that can keep pace with the changing industry. Patr is a platform that understands these needs and is designed to provide developers with the power and flexibility they require to build and deploy their applications with ease. This guide will walk you through the process of migrating an app from Heroku to Patr.
Prerequisites: What you'll need
In order to migrate from Heroku to Patr, the following tools are required:
- An account on Patr (You can sign up for one here).
- Patr CLI: Install instructions below
- Heroku CLI: Install instructions can be found here.
- Procfile: Procfile in the root directory of your Heroku app.
- Docker: Install instuctions for Docker can be found here.
Installing Patr CLI
To migrate your deployments from Heroku to Patr, you need to install the Patr CLI. You can install the CLI by running the command for your operating system:
Ubuntu users:
sudo snap install patr --classic --channel=beta
macOS users:
brew install patr-cloud/cli-beta/patr
Windows users:
choco install patr --pre
For any other operating systems or distros, binaries for the CLI can be found in our repository
Login to Patr CLI
Once the Patr CLI is installed, log in to it with your Patr credentials, using the following command:
patr login
This will prompt for your Patr Username and password. Once that's entered, you will be logged in.
Using Heroku CLI
Ensure that you have Heroku CLI installed, and logged in. Patr CLI uses the Heroku CLI to detect the details of your Heroku deployment and uses that to migrate. You can find details on installing the Heroku CLI here.
Start the Migration process
Now that the Heroku CLI is installed, you can start the migration process by running the following command:
patr migrate heroku --app <heroku-app-name>
Once you run this, Patr will detect your app on Heroku and start the migration process after creating a Dockerfile in your root directory.
After this, a list of your current Container Repositories on Patr will be displayed. In case you don't have any, you can create one using the CLI.
If you would like to continue with an existing Patr Registry Repository continue by entering 'y'. You'll be prompted to enter the name of the repository you would like to select.
In case you would like to create a new Container Repository enter 'n'. You'll be prompted to enter the name of the repository you would like to create.
Building the Image
After creating/choosing a repository, enter the name of the repository tag you would like to assign to your Docker image. Just press enter once you have assigned the tag, and leave it empty if you would like to default it to latest
.
Following this, Patr will build your Docker image and create a Docker container for deploying your app. Once it's created, you can try accessing your application(that will be running locally) by opening your browser to https://localhost:3000
(replace 3000
with the port your application is running on). Once you have confirmed that your application is working as expected, enter 'y' to continue deploying the application on Patr. You can, alternatively, enter 'n' in case you would like to terminate the process.
After this, your deployment will get created on Patr and you can access it using the link provided on Patr. To make any changes to the deployment head onto the link mentioned or access them at Deployments.