I've just purchased a new computer (mac OSX) and I want to continue developing using the same database I had on the old computer. I don't want it remotely done cause I dont want to keep the other computer on. I just want to copy the db and put it on this computer for development. I have a USB stick I can use but I'm not sure how to proceed. brew, rails, ruby, rvm, pg are all installed and configured.
Asked
Active
Viewed 1,104 times
1
-
have you tried pg_dump? The standard mode produces ascii. --schema-only and --data-only might prove useful (you need them both). You might need separate passes (of pg_dumpall) to dump users and tablespaces, if any. – wildplasser Jan 25 '13 at 00:49
-
I'm pretty new to programming. Can I just copy a file that hold the data on to a USB stick and paste into the corresponding file on the new computer? – Jaqx Jan 25 '13 at 00:54
1 Answers
2
pg_dumpall ? To dump all databases:
$ pg_dumpall > db.out
To reload this database use, for example:
$ psql -f db.out postgres
I had to do it with -o option for the oids

resultsway
- 12,299
- 7
- 36
- 43