Misc stuff - TwoGears/hakomo-guides GitHub Wiki
##Miscelaneous things to remember
Backup and import Postgres database
Capture:
heroku pg:backups:capture
heroku pg:backups:download
Import:
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
DEPLOYMENT HEROKU
Before you start with heroku make sure that you:
- create migration files and migrate locally
- if you installed anything with pip, run
pip freeze > requirements.txt
in the correct folder
On Heroku
- Stop heroku:
heroku maintenance:on
- Backup
heroku pgbackups:capture
- Get the new changes:
git push heroku master
- Do all necessary migrations
heroku run python manage.py migrate
NOTE: on older versions with south, you might need to add the app name at the end
- Turn on heroku again
heroku maintenance:off
- Test it!!!