Not entirely sure what you asking but I'm going to try...
Lets first understand the two main moving parts in Strapi.
- The content-type-builder (use the content-type builder to create a content type eg. books)
- 1.1) You should always create your content-types using the content-type-builder in your
local environment and then push it to your host(Heroku)
This is also recommended by Strapi and to enforce it they have disabled the content-
type-builder plugin when NODE_ENV is set to production.
- The content-type-data (use the above created books-content-type to create a book)
- 2.1) As of writing this Strapi v3.1.4 Strapi cannot move your content-type-data between environments for you. ie. If you create a books content-type and you use it to create a book in your localhost environment then that book will only exist in your local environment.
If you do need/want to move your content-type-data between environments you need to develop a migration mechanism that will seed the data from one database to the next.
as a rough example:
In your ./config/functions/bootstrap.js file you can create a module that gets content-type-data from your heroku instance via the public api and seeds that into your local database.
For this to work you need to set the content-types' permission for read access in the heroku app.
example bootstrap.js
const productionSeed= require('./seeds');
module.exports = async () => {
if (process.env.NODE_ENV == "development") {
await productionSeed.seedData();
}
};
example seed.js
module.exports.seedData= async () => {
try {
//Sudo code:
var books = GET http://{heroku-app-name}/books
foreach(book in books){
await strapi.services.books.create({
name: book.name;
});
} catch (error) {
console.error(error);
}
};
This is the long way of doing it when the use case is simple.
A Production database should be migrated using a migration script which you can call and use in the same way.
If you want to move the actual content-type then you will have to clone your heroku git repository, you can do so using heroku git:clone -a {app name}
N.B A Heroku app’s Git repository is intended for deployment purposes only. Cloning from this repository is not officially supported as a feature and should be attempted only as a last resort.
you can find out more here: https://devcenter.heroku.com/articles/git-clone-heroku-app