website logo
Sign Up PricingApp Templates
⌘K
🚀Getting started
Create an account in Microtica
Create an application from template
Import an existing application
Scaling Applications in Microtica
Assign a Custom Domain
⏰Changelog
📚Ready-to-use Templates
Strapi Serverless
Medusa Server
Appwrite
SPA on CloudFront
Amazon EKS
Node.js
n8n Workflow Automation
Next.js
🤖Migrate to Microtica
Migrate from Heroku to AWS
🚦Pipelines
Pipeline Syntax
Steps
Stages
Artifacts
Variables
↩️Automated Rollbacks
🔗Integrations
Connect an AWS account
Connect an Existing Kubernetes Cluster
Connect a Container Registry
⚙️Project Settings
Manage teammates
Manage pricing plan and billing
Docs powered by archbee 

Migrate from Heroku to AWS

13min

One-click Deploy

Click the Deploy with Microtica button below and follow the template steps to migrate your existing Heroku application to your AWS account.

<p style="margin: -70px 0 -40px 0">
    <a target="_blank" href="https://app.microtica.com/templates/new?template=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrotica%2Ftemplates%2Fmaster%2Fimport-app%2Ftemplate.yaml&import=true&utm_source=docs&utm_medium=one_click_deploy_button&utm_campaign=migrate_from_heroku">
        <img src="https://microtica.s3.eu-central-1.amazonaws.com/assets/templates/logos/deploy-with-microtica.svg" alt="Deploy with Microtica" width="180px" />
    </a>
</p>


This is a step-by-step tutorial on how to migrate your existing project from Heroku to AWS, using Microtica’s ready-made infrastructure and application templates. This guide applies to developers that have a running application on Heroku with PostgreSQL or MySQL database and covers:

  1. Setup of infrastructure on AWS
  2. Importing your existing application
  3. Migrating PostgreSQL/MySQL database from Heroku to AWS

If you want to deploy a new application on AWS, here is a guide on How to create an application from a template.

1. Create an EKS cluster on AWS

You can provision a complete Kubernetes cloud infrastructure through Microtica, or you can connect your existing Kubernetes cluster running on basically any cloud provider or on-premise. 

Microtica K8s is fully integrated with Microtica pipelines so you can easily define your automation to build, test and deploy services on Kubernetes in one place. 

To create a Kubernetes infrastructure on your AWS account follow the complete guide below:

Amazon EKS

A step-by-step guide on how to create a Kubernetes cluster on your AWS account.  

2. Import your existing app

Using our templates you can import any application you already have on your Git account. We support all the popular Git providers, like GitHub, GitLab, Bitbucket, and CodeCommit. Import your repository, select a cluster and deploy your app. Follow the tutorial below:

Import an existing application

A step-by-step guide on how to import your existing application and deploy it on AWS.

3. Migrate database from Heroku to AWS

Download all data from the Heroku database locally

To export the data from your Heroku Postgres database, create a new backup and download it, using the following commands:

PostgreSQL
|
heroku pg:backups:capture --app example-app
heroku pg:backups:download --app example-app


To export the data from your Heroku MySQL database, dump the Heroku database on your local development environment using mysqldump tool.

MySQL
|
mysqldump --set-gtid-purged=OFF --single-transaction -hHOST_HERE -uUSER_HERE -P PORT_HERE -p DB_NAME_HERE > heroku_db

# --set-gtid-purged=OFF - required property for RDS because you don’t have full permission in RDS.
# --single-transaction – Use to ensure that all of the data loaded from the local database is consistent with a single point in time. If there are other processes changing the data while mysqldump is reading it, using this option helps maintain data integrity.
# -h - hostname of the DB. No space between -h and the value.
# -u – Use to specify a user name. No space between -u and the value.
# -P - mysql port
# -p - once the command is run you’ll be asked for the DB password
# DB_NAME_HERE - the name of the database you want to download locally


If you get this error message "Unknown table 'COLUMN_STATISTICS' in information_schema", add the command --column-statistics=0. The command adds ANALYZE TABLE statements to the output to generate histogram statistics for dumped tables when the dump file is reloaded.

If you get this error message "Access denied; you need (at least one of) the PROCESS privilege(s) for this operation", add the command --no-tablespaces. The suppresses all CREATE LOGFILE GROUP and CREATE TABLESPACE statements in the output of mysqldump.

Connect to Amazon RDS database

To establish a connection between your local development environment and AWS please follow the Access the RDS database guide.

Once the connection is established, you can proceed with moving the local copy of the data to AWS.

Move local database copy to AWS

Load the dump into your Amazon RDS PostgreSQL using the pg_restore tool.

PostgreSQL
|
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U dbuser -d strapi latest.dump


Load the dump into your Amazon RDS MySQL database using the mysql tool.

MySQL
|
mysql -udbuser -h localhost -P 3306 -p strapi < heroku_db




Updated 03 Mar 2023
Did this page help you?
Yes
No
PREVIOUS
Migrate to Microtica
NEXT
Pipelines
Docs powered by archbee 
TABLE OF CONTENTS
One-click Deploy
1. Create an EKS cluster on AWS
2. Import your existing app
3. Migrate database from Heroku to AWS
Download all data from the Heroku database locally
Connect to Amazon RDS database
Move local database copy to AWS