Hello,
Just curious if anyone could provide instructions on steps I would take to export SQL from production (WebFaction phpPgAdmin) and import on local dev using pgAdmin3 (and postgres.app)?
I'd just like a quick way to get production data into my development machine; I'd like to have the production dump wipe my dev database and insert the latest dumped data. Optimally, I would like to do as much of this as possible via that web and application interfaces (though, I'm not opposed to command line solutions).
Anyone out there have this already documented and feel like sharing their steps? :)
This is for a Django app development workflow.
Thank you!
Edit:
Here's what I have so far:
- Login to WebFaction’s Control Panel and go to the Databases section.
- Click on the phpPgAdmin link.
- Login to phpPgAdmin.
- In the left pane of the phpPgAdmin window, expand Servers, expand PostgreSQL, and then click the name of the database that you want to export.
- On the top menu bar, click “Export” (far right).
- Under Format, click Structure and data.
- Under Options, in the Format list box, select SQL.
- Under Options, click Download.
- Click “Export”.
- On your local machine, start
psql
and open pgAdmin3.
- In pgAdmin3, right-click on the database and select Delete/Drop…
- Re-create the database by right-clicking on "Databases" icon and choosing "New Database…"; just input the name and and click “OK”.
- Click on Plugins > PSQL Console.
- From the command line, run:
$ \i /path/to/your-dumped-phpPgAdmin.sql
Tip: From the command line, you can type \i
and then drag/drop the .sql
file into the the terminal window and hit return key.
Can the above process be improved?
asked
01 Feb '15, 05:43
mhulse
41●1●7●17
accept rate:
0%