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:

  1. create migration files and migrate locally
  2. if you installed anything with pip, run pip freeze > requirements.txt in the correct folder

On Heroku

  1. Stop heroku:
heroku maintenance:on
  1. Backup
heroku pgbackups:capture
  1. Get the new changes:
git push heroku master
  1. 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

  1. Turn on heroku again
heroku maintenance:off
  1. Test it!!!