Subject Re: [firebird-support] GBAK Options
Author Helen Borrie
At 09:35 AM 5/08/2008, you wrote:
>With GBAK restore function we used to have
>-c[reate_database] - Restore database to a new file
>and
>-r[eplace_database] - Restore database to a new file or replace existing
>
>I understood these options - I'd never use the -r option because I would
>never replace an existing database.
>
>Now we have:
>-C(REATE_DATABASE) create database from backup file
>-R(ECREATE_DATABASE) [O(VERWRITE)] create (or replace if OVERWRITE used)
>database from backup file
>-REP(LACE_DATABASE) replace database from backup file
>
>
>The release notes are a litle confusing:
>"• gbak -R (or gbak -r) now applies to the new -R[ECREATE_DATABASE] switch
>and will never overwrite
>an existing database if the O[VERWRITE] argument is absent
>• The short form of the old gbak -R[EPLACE_DATABASE] is now
>-REP[LACE_DATABASE]. This switch
>does not accept the O[VERWRITE] argument.
>• The -REP[LACE_DATABASE] switch should be considered as deprecated, i.e. it
>will become unavailable
>in some future Firebird release.
>This change means that, if you have any legacy batch or cron scripts that
>rely on “gbak -r” or “gbak -R” without modification, then the operation will
>except if the database exists.
>If you want to retain the ability of your script to overwrite your database
>unconditionally, you will need to
>modify the command to use either the new switch with the OVERWRITE argument
>or the new short form for
>the old -REPLACE_DATABASE switch."
>
>This states that -REP is deprecated. But it is NEW?

No, it's the same switch that gave the deprecated behaviour. The difference is that now using the abbreviated form -R doesn't give you the old overwrite behaviour...meaning, if you insist on it, you needed to have coded it as one of the following:

gbak -rep
gbak -repl
gbak -repla
gbal -replace
gbak -replace_
gbak -replace_d
gbak -replace_da
gbak -replace_dat
gbak -replace_data
gbak -replace_datab
gbak -replace_databa
gbak -replace_databas
gbak -replace_database
> Why did we introduce a new switch and deprecate it?

The new switch is gbak -r[ecreate_database] and it's not deprecated.

>Introducing the O switch was enough wasn't it?

There's no O switch. OVERWRITE is an argument to -r[ecreate_database] and it can only be applied to gbak -r[ecreate_database]. Its purpose is to reproduce the behaviour that came with the old, deprecated -replace_database switch.

./heLen