1
# Copyright 2009 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
# This shell script can be used to restore a production database dump
6
DMP=launchpad_prod.20050207.pg_dump
14
| grep -v CONSTRAINT \
21
pg_restore -l ${DMP} | grep TABLE >> r.listing
22
pg_restore -l ${DMP} | grep VIEW >> r.listing
23
pg_restore -l ${DMP} | grep INDEX >> r.listing
24
pg_restore -l ${DMP} | grep CONSTRAINT >> r.listing
25
pg_restore -l ${DMP} | grep TRIGGER >> r.listing
26
pg_restore -l ${DMP} | grep SEQUENCE >> r.listing
27
pg_restore -l ${DMP} | grep COMMENT >> r.listing
28
pg_restore -l ${DMP} | grep BLOBS >> r.listing
29
pg_restore -l ${DMP} | grep ACL >> r.listing
33
createdb -E UNICODE ${DBNAME}
34
pg_restore -U postgres --no-acl --no-owner -L r.listing -d ${DBNAME} -v ${DMP} 2>&1 | grep -v NOTICE
35
env LP_DBNAME=${DBNAME} python security.py