Thread: Working with one live and one development database
Hi all, We are moving from MySQL to PgSQL in my organization and I would like some input on what the best method is for working with one development and one live database. We need to copy all data, structure information, functions et.c. from the live database to the development database every now and then. The development database will be on a separate machine. What is the best way to do this? Kind regards Hugo Wetterberg
On 5 Dec 2006 at 2:59, hugo.wetterberg@gmail.com wrote: > live database. We need to copy all data, structure information, > functions et.c. from the live database to the development database > every now and then. The development database will be on a separate > machine. What is the best way to do this? I do that every now and then.....I simply do a complete dump of the database I need using pg_dump, and then reload it on the development machine using psql (I generally do a text-format dump). --Ray. ---------------------------------------------------------------------- Raymond O'Donnell Director of Music, Galway Cathedral, Galway, Ireland rod@iol.ie ----------------------------------------------------------------------
On Tue, 2006-12-05 at 04:59, hugo.wetterberg@gmail.com wrote: > Hi all, > We are moving from MySQL to PgSQL in my organization and I would like > some input on what the best method is for working with one development > and one live database. We need to copy all data, structure information, > functions et.c. from the live database to the development database > every now and then. The development database will be on a separate > machine. What is the best way to do this? I do this quite often for testing purposes. If the dbs are on different machines, then, from a place that can connect to both machines, something like: // if the slave_server db exists: dropdb -h slave_server -U superuser dbname createdb -h slave_server -U superuser dbname pg_dump -h master_server -U superuser dbname | psql -h slave_server -U superuser dbname