Skip to content

Instantly share code, notes, and snippets.

@nad2000
Last active August 29, 2015 13:56
Show Gist options
  • Save nad2000/ad2800dd856f0b1eea25 to your computer and use it in GitHub Desktop.
Save nad2000/ad2800dd856f0b1eea25 to your computer and use it in GitHub Desktop.
choice_web DB transfer form PostgreSQL 8.1 to 9.3
# 1. download and install PostgreSQL 9.3 (remember the password your entered)
# 2. install PostGIS using Stackbuilder (it's a part of PostgreSQL 9.3 installation)
# Make sure postgeres is started
# Run script that fix issues with choice_web:
psql -U postgres -d postgres -f choice_web_migr.sql
# Load the dump (that might take upto 10min):
psql -U postgres -f choice_web_02_21_2014.dump -d choice_web 2>choice_web_log.err
# Dump only user object and data (that will get rid of old PostGIS stuff):
pg_dump -N public -N tiger -N topology -U postgres -d choice_web -f choice_web.dump
# The output expected to be ~ 275 Mb large
# Run script that will re-create choice_web DB with PostGIS and dblink extensions:
psql -U postgres -d postgres -f choice_web_migr2.sql
# Load the DB from the last dump:
psql -U postgres -f choice_web.dump -d choice_web 2>choice_web_log2.err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment