3 # Dumps the planetlab3 database on zulu, fixing a few things on the way
5 # Mark Huang <mlhuang@cs.princeton.edu>
6 # Copyright (C) 2007 The Trustees of Princeton University
38 site_authorized_subnets
41 dslice03_attributetypes
44 dslice03_sliceattribute
55 dslice03_defaultattribute
61 for table in "${tables[@]}" ; do
62 pg_dump -U postgres -t $table planetlab3
65 # Do some manual cleanup
67 # Swap person_id=1 (kfall@cs.berkeley.edu) with person_id=1303 (maint@planet-lab.org)
68 /^COPY \(persons\|person_roles\|person_capabilities\|person_address\|person_keys\|person_site\|node_root_access\)/,/^\\\./{
74 /^COPY dslice03_sliceuser/,/^\\\./{
81 # Swap person_id=2 (nakao@cs.princeton.edu) with person_id=13342 (root@planet-lab.org)
82 /^COPY \(persons\|person_roles\|person_capabilities\|person_address\|person_keys\|person_site\|node_root_access\)/,/^\\\./{
88 /^COPY dslice03_sliceuser/,/^\\\./{
95 # Swap site_id=1 (gt) with site_id=90 (pl)
96 /^COPY \(sites\|site_authorized_subnets\|dslice03_siteinfo\)/,/^\\\./{
102 /^COPY \(person_site\|pcu\)/,/^\\\./{
103 s/\([^\t]*\t\)1\t/\190\t/
105 s/\([^\t]*\t\)90\t/\11\t/
108 /^COPY \(dslice03_slices\)/,/^\\\./{
109 s/\([^\t]*\t[^\t]*\t\)1\t/\190\t/
111 s/\([^\t]*\t[^\t]*\t\)90\t/\11\t/
117 # Dump events and api_log schema only
118 pg_dump -U postgres -s -t events planetlab3
119 pg_dump -U postgres -s -t api_log planetlab3