Templates
Strapi Serverless

Migrate your Strapi app from Heroku to AWS

9min

One-click Deploy

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



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

  1. Setup of Strapi infrastructure on AWS
  2. Migrating PostgreSQL/MySQL database from Heroku to AWS

If you don’t have an existing Strapi project on Heroku, here is a guide on how to deploy a new Strapi Application on your AWS account.

Before we get started, please make sure you:

1. Setup Strapi infrastructure on AWS

To setup the serverless infrastructure for your existing Strapi application please follow the Deploy an Existing Strapi App guide.

When configuring the template make sure that you select postgres or mysql as DatabaseClient.

Once the infrastructure is deployed and ready (which should be in about 10 minutes), you can proceed with migrating your existing data from Heroku to AWS.

2. 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


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

MySQL


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


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

MySQL