This guide is written for pgAdmin 3, which is no longer supported by pgAdmin. You can still follow these directions to open your snapshot using pgAdmin 3, but be aware that this guide does not apply to pgAdmin 4.
This HOWTO will teach you how to open a NationBuilder snapshot on your Mac, so that you can work with your data outside of NationBuilder. If you need to restore information from a snapshot to your nation, please contact email@example.com. This guide uses Postgres App to run a local PostgreSQL server, and pgAdmin to manage and administer the database. You can also run a PostgreSQL server from the command line or use other PostgreSQL admin/management software to work with .dump files.
Table of Contents
Using the Postgres/pgAdmin Apps
Install Postgres App
Install pgAdmin 4
Open the Postgres App.
- Open psql (this will open a terminal window with psql started)
- Make owner "nbuild" as a superuser:
- CREATE ROLE nbuild WITH SUPERUSER LOGIN;
- Create a new database "nbuild" with owner "nbuild" with the following command:
- CREATE DATABASE nbuild OWNER nbuild;
- Connect to the "nbuild" database:
- \c nbuild;
Paste the following command, replace "SLUG" with the slug of the nation the snapshot is from.
- CREATE SCHEMA nbuild_SLUG; CREATE SCHEMA shared_extensions; CREATE EXTENSION hstore WITH schema shared_extensions; CREATE EXTENSION dblink WITH schema shared_extensions; CREATE EXTENSION citext WITH schema shared_extensions; CREATE EXTENSION pg_trgm WITH schema shared_extensions;
- Note: You may have to change your Mac's security settings to allow unsigned applications (Learn how to change your Mac's security settings).
Add a connection to a server (the plug icon in the top left of the application).
Find your schema, right click and select Restore.
Select your .dump file from where you downloaded it to, then click Restore.
Now you should be good to go!
SQL Tutorial from W3Schools.com