Move database from one server to another
Hey Mats,
If you go for option 1, something like this:
Launch program pg_dump -d=databasename -h=ipaddress -U=backupuser
-f=mybackup.backup << password (Do not quit Omnis)
or
Start program normal {pg_dump -d=databasename -h=ipaddress -U=backupuser
-f=mybackup.backup << password}
Just need to add paths probably and make sure pg_dump is included with
you install.
Cheers,
Bas
On 23/7/17 4:08 pm, ADJob wrote:
> Hi,
>
>> 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:
>> www.postgresql.org/docs/9.3/static/functions-admin.html#FUNCTIONS-ADMIN-BACKUP
>> 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.
>
> Any clue?
>
> /Mats
>
>
>
>
>
>
>
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
>
>
—
Kindest Regards,
Bastiaan Olij
e-mail: bastiaan@basenlily.me
web: www.basenlily.me
Skype: Mux213
www.linkedin.com/in/bastiaanolij
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com