Skip to content
Fraser Harris edited this page Oct 4, 2015 · 6 revisions

Generate DB Dump

Local VM

  • ssh into the virtual machine
  • log in as postgres: sudo su postgres
  • run the command pg_dump sfdb > db.dump
  • once the db dump is complete exit postgres

Remote Machine

  • ssh into a production or stage server (ssh willet@__server_ip_address__)
  • run the command pg_dump sfdb > db.dump
  • use the database password in /SecondFunnel/ansible/group_vars/[production|stage].yml

NOTE: If you are copying the database from production/stage to vagrant, you need to make sure you do not copy owners & privileges: pg_dump --no-owner --no-privileges sfdb > db.dump. When you pg_restore from the db.dump, you will need to make sure the db is assigned an owner using: createdb -O __owner_name__ sfdb. See /SecondFunnel/ansible/group_vars/vagrant.yml for db owner name.

Move DB Dump

  • once the db dump is complete, exit to local
  • download db dump to local: scp willet@__server_ip_address__:/opt/secondfunnel/app/db.dump db.dump

Clone this wiki locally