~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/restoredump.sh

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2004-06-28 10:08:03 UTC
  • mfrom: (unknown (missing))
  • Revision ID: Arch-1:rocketfuel@canonical.com%soyuz--devel--0--patch-8
add ./sourcecode directory
Patches applied:

 * david.allouche@canonical.com--2004/soyuz--devel--0--base-0
   tag of rocketfuel@canonical.com/soyuz--devel--0--patch-7

 * david.allouche@canonical.com--2004/soyuz--devel--0--patch-1
   add ./sourcecode directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
2
 
# GNU Affero General Public License version 3 (see the file LICENSE).
3
 
#
4
 
# This shell script can be used to restore a production database dump
5
 
 
6
 
DMP=launchpad_prod.20050207.pg_dump
7
 
DBNAME=rest
8
 
 
9
 
pg_restore -l ${DMP} \
10
 
    | grep -v SEQUENCE \
11
 
    | grep -v TABLE \
12
 
    | grep -v ACL \
13
 
    | grep -v INDEX \
14
 
    | grep -v CONSTRAINT \
15
 
    | grep -v VIEW \
16
 
    | grep -v TRIGGER \
17
 
    | grep -v COMMENT \
18
 
    | grep -v ACL \
19
 
    | grep -v BLOBS \
20
 
    > r.listing
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
30
 
 
31
 
 
32
 
dropdb ${DBNAME}
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