2011/08/24, 16:30
browsing the git history in a compact yet still highly condensed view containing all important information:
git log --graph --source --oneline --branches --tags |
2011/08/23, 16:13
e.g. for testing purposes before touching valuable data…
- set the DB names
ORIG_DB="orig_db_name"
NEW_DB="new_db_name" |
- create a dump (make sure to use a user having access rights to the db)
TSTAMP=$(date +%F_%H-%M)
FILE_ORIG="${ORIG_DB}_${TSTAMP}.sql"
pg_dump -f ${FILE_ORIG} --blobs --create ${ORIG_DB} |
- adjust the DB name in the dump and check everything went ok (the diff should be just in CREATE, ALTER and \connect statements)
FILE_NEW="${NEW_DB}_based-on_${ORIG_DB}_${TSTAMP}.sql"
sed "s/${ORIG_DB}/${NEW_DB}/g" ${FILE_ORIG} > ${FILE_NEW}
vimdiff ${FILE_ORIG} ${FILE_NEW} |
- adjust permissions for the new db (add the new DB name to the desired user(s)) and reload the postgres config
sudo vim /etc/postgresql/8.4/main/pg_hba.conf
sudo /etc/init.d/postgresql-8.4 reload |
- load the new DB’s SQL-code into postgres
- to set identical permissions on the new DB, create a full dump using pg_dumpall, check the GRANT commands in the dump and apply them to the new DB as well…
2011/08/01, 18:04
wow: http://bodensee-navigationskarte.scbh.at/