Skip to content

Instantly share code, notes, and snippets.

@ray-odoo
Last active September 28, 2018 17:12
Show Gist options
  • Save ray-odoo/bd97d69b3e308d10f531c8392b71f7d6 to your computer and use it in GitHub Desktop.
Save ray-odoo/bd97d69b3e308d10f531c8392b71f7d6 to your computer and use it in GitHub Desktop.
Large database backup and restore process
OUT:
pg_dump production --no-owner --format=c --file=production.sql
FILESTORE:
tar -czvf /home/ubuntu/production.tar.gz production
IN:
createdb prod_backup_date --owner=odoo
pg_restore --dbname=prod_backup_date --format=c --no-owner --role=odoo < production.sql
tar -xvf production.tar.gz ./prod_backup_date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment