5 Simple Steps To Migrate From Heroku to AWS

While Heroku is ideal for startups because it provides tremendous simplicity and time-saving; Still, when your application starts growing, and its architecture becomes complex, challenges related to DevOps, data security, and scalability begin to jump in. That’s where AWS takes over to help overcome these limitations. In this article, we will learn how to migrate your applications from Heroku to AWS in 5 simple steps with Qovery.

Albane Tonnellier

Albane Tonnellier

June 8, 2022 · 6 min read
5 Simple Steps To Migrate From Heroku to AWS - Qovery

Read our complete guide on how to Migrate from Heroku to AWS here

#Why do startups leave Heroku for AWS?

But first, let’s talk through some main reasons growing startups leave Heroku to AWS. This study shows that almost 50% of growing startups started their business on Heroku and migrated to a Cloud provider - especially AWS (Amazon Web Services). Let us unpack the three big reasons:

  • The lack of transparency on Heroku infrastructure— When startups grow, they all seek better control and ownership of their infrastructure, whether the servers we use or cloud hosting for our apps. Deploying apps on Heroku platform doesn't give you ownership and control of the infrastructure; Heroku owns it, and users get access to it.
  • The need to have more control— The primary ingredient in scaling up is to have more control. Here, unlike Heroku, AWS services offer enhanced control, avoiding the limitations on scalability and allowing more customized infrastructure management. For example, in networking, the applications can only listen on a single port, and startup constraints of mandatory booting up in less than a minute, doing development under these constraints limits controls and scaling-up opportunities.
  • Heroku is outrageously expensive— Even though AWS is not known for being cheap, and Heroku is no longer free, it is up to 10x more expensive than AWS for the same use. The more you use it, the more your bills go up. Peace of mind at a price, but it's tough to scale with Heroku.

#Why should you consider Qovery to migrate from Heroku to AWS?

Let’s talk through some of the benefits of using Qovery to migrate from Heroku to AWS:

  • AWS Infrastructure setup is simple and quick— You do not need cloud infrastructure expertise, and you can set up the infrastructure in just four simple steps (see our step-by-step guide here)
  • Get the Heroku-like experience with the flexibility you need— Qovery offers fully automated deployments to your AWS account. You get the same developer experience as Heroku (no DevOps knowledge required), but now you can inspect and tweak anything without Heroku limiting you.
  • Deploy and scale effortlessly— Qovery utilizes a Kubernetes cluster behind the scenes (EKS). Qovery manages and scales services in your existing AWS account so you can focus on building products instead of managing its infrastructure.
Read the case study of Patrick Nollet, CTO of Traace: http://www.qovery.com/case-study/traace
Read the case study of Patrick Nollet, CTO of Traace: http://www.qovery.com/case-study/traace

#The 5 Simple Steps to Migrate From Heroku to AWS

Migration has never been that simple! Let me explain how to migrate from Heroku to AWS with Qovery easily. Before we dive in, let’s assume the following:

  • You are familiar with Heroku basics, have a Heroku account, and have access to Heroku CLI
  • You have sign-in on Qovery
  • You have set up your AWS account with Qovery, facilitating your migration to AWS

Let’s start!

#Step 1: Create your Dockerfile or use Buildpacks

To build and run your application from Heroku, you can either use Buildpacks or create a Dockerfile. Both options build a container image runnable by a container engine (E.g., Docker).

Qovery runs containers on Kubernetes. Buildpacks automatically detect the language and the framework your application is using. Buildpacks build and run your app. Here is the list of supported languages and frameworks. However, Qovery Buildpacks does not support Procfile with multiple commands at the moment or customs Buildpacks, so if you want to keep complete control of everything, we recommend creating a Dockfile, and if you’re not sure where to start, here is a great tutorial to create a Dockerfile.

#Step 2: Create resources on Qovery

After successfully creating your Dockerfile or using Buildpacks, it’s time to create resources on Qovery. You will want to create an application, then possibly a Database, and it starts in the Qovery Console. If you are new to Qovery, we advise you to watch this tutorial on “how to deploy your first app” or this one on “how to create a database”. ⚠️ Once your application is created, it won’t be deployed just yet! Before deploying it, you can configure the CPU, Memory, and Environment Variables... before deploying it. If you want to deploy it before finishing the configuration, you can click on "Actions" > "Deploy".

Qovery console with one application and a database setup
Qovery console with one application and a database setup

#Step 3: Configure Environment Variables and Secrets

After creating resources on Qovery, it’s time to configure Environment Variables and Secrets!

Qovery makes the difference between an Environment Variable and a Secret. A Secret is similar to an Environment Variable, but the value is encrypted and can't be revealed. Both are injected as environment variables during the build and the run of your applications.

To extract your environment variables from Heroku, we recommend using the Heroku CLI and exporting all the environment variables and secrets in a .env (dot env) file. Qovery supports the import of a dot env file via the Qovery web interface and the Qovery CLI.

Then you can create your environment variables via the web interface or the Qovery CLI.

Once it’s done, you want to connect your frontend app to your backend app, and for that, we will create an environment variable alias; then, you will need to connect your backend app to your database.

#Step 4: Copy data from your Heroku databases to your AWS databases

This one is not yet ready, but it will soon be possible to Replibyte, which will simplify the process of running your data migration smoothly and efficiently from Heroku to AWS, so keep an eye open for it!

#Step 5: Deploy your apps

Now that everything has been created and is well connected, it will be time for you to deploy your application; once on the console, go on your application panel, select “deploy”, and let the magic happen!

#Final result

You can’t believe that it can be that easy? Here is a live demo to show you how fast the process is:

If you want to see every step with tutorials, we recently updated our documentation and recommended you check it out.

#Post-Migration Best Practices

After migrating to AWS, it's essential to optimize and manage your AWS environment:

  • Optimizing Resources: Regularly review AWS usage with tools like Cost Explorer. Adopt auto-scaling and consider AWS Savings Plans for cost-effective operations.
  • Efficient Monitoring: Use AWS CloudWatch for real-time monitoring, setting up custom metrics and alarms to maintain system health.
  • Security and Compliance: Regularly update AWS IAM policies, utilize AWS Shield for protection, and conduct periodic security assessments.
  • Disaster Recovery: Implement a robust backup strategy using AWS S3 and RDS for data resilience.
  • Staying Updated: Keep abreast of the latest AWS features, especially in areas like AI, serverless computing, and containerization.

#Wrapping up

We hope this article helped you shed light on what AWS can bring to your startup and made you realize that migrating from Heroku to AWS doesn’t have to be challenging if you use Qovery! Ready to give it a go? Start deploying your apps on AWS with Qovery now 👇

Your Favorite DevOps Automation Platform

Qovery is a DevOps Automation Platform Helping 200+ Organizations To Ship Faster and Eliminate DevOps Hiring Needs

Try it out now!
Your Favorite DevOps Automation Platform
Qovery white logo

Your Favorite DevOps Automation Platform

Qovery is a DevOps Automation Platform Helping 200+ Organizations To Ship Faster and Eliminate DevOps Hiring Needs

Try it out now!
AWSHerokuQovery