Update karlstaging with production db dump file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KARL3 |
Fix Released
|
Medium
|
Paul Everitt |
Bug Description
We need to update karlstaging's database with the dump from production. The dump file is in /home/ctheune/
Notes from the exchange between Tres and gocept:
Tres wrote:
Also, has the sync script been adjusted to deal with the recurring
permission problems we have seen in the past following such a sync?
Christian replied:
To fix issues with permissions for good, I created a PostgreSQL
role/user named
"osf" (same as in production) that uses the same password as currently
used for
the staging role.
The next import should be run like this:
# stop appservers
$ sudo -u karlstaging -i
$ dropdb karlstaging
$ createdb -U osf -W karlstaging
$ pg_restore -eO -h localhost -U osf -W -n public -d karlstaging /home/ctheune/
# start appservers
This should cause the ownership issues to be solved then.
tags: | added: r3.126 |
Changed in karl3: | |
status: | New → In Progress |
Changed in karl3: | |
assignee: | Chris Rossi (chris-archimedeanco) → Christian Theune (ct-gocept) |
Changed in karl3: | |
assignee: | Christian Theune (ct-gocept) → Chris Rossi (chris-archimedeanco) |
Changed in karl3: | |
assignee: | Shane Hathaway (shane-hathawaymix) → Paul Everitt (paul-agendaless) |
I don't entirely understand what's going on here:
$ pg_restore -f /home/ctheune/ box/karldump/ karl.sql
/usr/bin/pg_restore -eO -h
localhost -U karlstaging -W
Is that a a single command? Two commands? Why do we have the full path to pg_restore in one place, but just the bare name in another?