I have a backup sql file from another database that I want to import into Heroku's postgres database. How do you do that?
相关问题
- NOT DISTINCT query in mySQL
- Flush single app django 1.9
- How to specify memcache server to Rack::Session::M
- How to reimport module with ES6 import
- Django distinct is not working
相关文章
- postgresql 关于使用between and 中是字符串的问题
- postgresql 月份差计算问题
- Using boolean expression in order by clause
- Table valued Parameter Equivalent in Postgresql
- in redshift postgresql can I skip columns with the
- Oracle equivalent of PostgreSQL INSERT…RETURNING *
- Django/Heroku: FATAL: too many connections for rol
- Heroku Web Server Won't Start Locally
Load the SQL into a local Postgres instance and make sure it's correct. Then dump the data using the directions here: https://devcenter.heroku.com/articles/heroku-postgres-import-export
Finally, upload the dump to a public web server (like S3) and restore to Heroku like this:
This is how you do it:
And if you want to restore your production into staging (assuming both are heroku postgres DBs):
Make sure to preserve the special single quotes around "heroku pgbackups:url --app YOUR_PRODUCTION_APP_NAME".
-------- HEROKU TOOLBELT UPDATE --------
Heroku has recently updated their toolbelt so the old commands are no longer valid (see this link for more info). Below is the new version of the restore command.
Making backup file:
Restoring from sql file to heroku :
(Bonus) Deleting all tables from heroku app database (example):
get DATABASE_URL from posgresql heroku panel (psql line)