
This script is just a simple tool to help me export the current PostgreSQL database into a format that is safe to send to a 3rd party. All of the data is public on Gerrit's website, except for the user's physical address contact information. We scrub that out because we do not have consent from our users to disclose that information. Signed-off-by: Shawn O. Pearce <sop@google.com>
19 lines
335 B
Bash
Executable File
19 lines
335 B
Bash
Executable File
#!/bin/sh
|
|
|
|
src=reviewdb
|
|
tmp=safedump
|
|
N="N.$$.sql"
|
|
|
|
dropdb $tmp
|
|
pg_dump $src >$N &&
|
|
createdb -E UTF-8 $tmp &&
|
|
psql -f $N $tmp &&
|
|
psql -c 'UPDATE accounts SET
|
|
contact_address = NULL
|
|
,contact_country = NULL
|
|
,contact_phone_nbr = NULL
|
|
,contact_fax_nbr = NULL' $tmp &&
|
|
pg_dump $tmp | bzip2 -9 >gerrit2_dump.sql.bz2
|
|
dropdb $tmp
|
|
rm -f $N
|