Templates
Strapi Serverless

Migrate your Strapi app from Heroku to AWS

9min
one click deploy https //docs microtica com/strapi serverless#ygkqs 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 setup of strapi infrastructure on aws 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 have access to your heroku account and cli create a microtica account 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 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 http //www postgresql org/docs/current/static/app pgrestore html 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 http //www postgresql org/docs/current/static/app pgrestore html mysql https //dev mysql com/doc/refman/8 0/en/mysql html tool mysql mysql udbuser h localhost p 3306 p strapi < heroku db