How can I import a .sql file into my Heroku postgres database?

后端 未结 4 1621
慢半拍i
慢半拍i 2020-12-04 11:09

I have a backup sql file from another database that I want to import into Heroku\'s postgres database. How do you do that?

4条回答
  •  Happy的楠姐
    2020-12-04 11:20

    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:

    heroku pgbackups:restore DATABASE 'https://s3.amazonaws.com/me/items/3H0q/mydb.dump'
    

提交回复
热议问题