Populate a postgreSQL database on Heroku
Learn how to populate a remote postgreSQL database on Heroku from an existing database dump.
Last updated
Learn how to populate a remote postgreSQL database on Heroku from an existing database dump.
Last updated
Please be sure of your agent type and version and pick the right documentation accordingly.
This is the documentation of the forest-express-sequelize
and forest-express-mongoose
Node.js agents that will soon reach end-of-support.
forest-express-sequelize
v9 and forest-express-mongoose
v9 are replaced by @forestadmin/agent
v1.
Please check your agent type and version and read on or switch to the right documentation.
If you don't have a Heroku application yet, take a look at this how-to.
We recommend adding on your Heroku application the free add-on “Heroku Postgres” (1)(2).
Once installed, your Heroku application will contain an environment variable DATABASE_URL
with the credentials of your new created database (1) in the “Config Vars” section (2). Here you can add more if necessary (3).
Your new database has no data yet, so you will need to import your local data to this new one.
To do that, you first need to create a dump of your local database.
Then, you need to import it to the Heroku database.
At this stage, your Heroku application is entirely running with its own database.
That's it! Your local database is now available as your production database on Heroku. 🎉
N.B: You can make sure by checking the Heroku logs using the command :