Move database from one server to another
mats at adjob.se
Sun Jul 23 02:08:58 EDT 2017
> Two ways about this that I know off.
> First option, you can simply include the pg_dump and pg_restore with
> your Omnis application and use them as they are. They're command line
> tools so. Its basically what PGAdmin does.
> Second option, pg_dump isn't really that special, it just selects all
> the data in your database and turns them into queries. It just has some
> nice options for encrypting/compressing the data. pg_restore in turn is
> nothing special either, it just executes whats in the file. There is
> nothing in there you couldn't just implement in Omnis. The secret sauce
> lies in these functions:
> You basically call pg_start_backup which will issue a checkpoint and
> ensures that all reads you do from then on relate to that point in time,
> ignoring any changes users make while your backup is running. You can
> then select and write out all the data you want to backup. Finally when
> you are done you call pg_stop_backup
> A restore is generally executed on an empty database so its simply a
> matter of loading your files and inserting the data
I do not need to backup a live database, so I do not se the point of using the pg_start_backup?
You are probably right, but I cannot find the syntax anywhere to do the dump / restore within Omnis.
More information about the omnisdev-en