philjclarke
philjclarke

Reputation: 81

How to deploy local Strapi content to Heroku

I have a local version of Strapi set up, and the codebase is pushing fine to Netlify for the frontend and Heroku for the backend. However, I can't work out how to get the content held in the .tmp/data.db file into the mLab instance of the database on Heroku. The structure is all in sync with my local version.

I've tried to export tables from SQL Lite to JSON files and then import them as collections using the CLI - which says it's imported the documents into Heroku (and I can see them in the mLab interface), but this was a last ditched attempt as I couldn't see a way of transferring the entire file. However, this isn't working as the content types are still empty.

Upvotes: 3

Views: 991

Answers (1)

Jim LAURIE
Jim LAURIE

Reputation: 4120

Make sure you well configured your ./config/environments/production/database.json with your mLab configs.

In development, you look using SQLite. This database is good for local development but can't be used in Heroku (see the storage system used by Heroku you will understand why.)

Be careful, you are using an SQL database in dev and a NoSQL database in production. This looks special - depending on your data structure, you can have issues about the data migration. I don't suggest you to do that. Use the same type of database in dev and prod.

Upvotes: 1

Related Questions