Subject Re: [firebird-support] gbak error
Author Helen Borrie
At 09:14 PM 10/10/2007, you wrote:
>To have an additional local database for testing purposes we tried to
>use gbak as following (batch-job running at night):
>C:\Programme\Firebird\Firebird_1_5\bin\gbak -B
><server>:\<path>\<database>.gdb C:\<path>\<backup>.gbk -user sysdba
>-pass masterkey

Problem 1: you need to use the remote Services Manager when running
gbak from your local client machine:

C:\Programme\Firebird\Firebird_1_5\bin\gbak -B -se
<server>:service_mgr D:\<path>\<database>.gdb C:\<path>\<backup>.gbk
-user sysdba
-pass masterkey

where both D: and C: are partitions on the remote host machine.

>C:\Programme\Firebird\Firebird_1_5\bin\gbak -R -C -V
>C:\<path>\<backup>.gbk localhost:C:\<path>\<localdatabase>.gdb -user
>sysdba -pas masterkey

Problem 2: The -R and -C switches are mutually exclusive. -R
overwrites an existing database of the same name; -C creates a new
database and refuses to proceed if a database of the same name
exists. If a database of the same name does not exist, then -R works
as -C. But don't supply *both* switches. (I am surprised you did
not get an error from this usage...did your batch job have any
provision to write a log? The -V switch does not write a log unless
you specify a file for it to go to...)

>The restore starts properly and restores all tables but results in the
>following error message:
>gbak: ERROR: Unable to complete network request to host "localhost".
>gbak: ERROR: Error reading data from the connection.
>gbak: ERROR: Eine vorhandene Verbindung wurde vom Remotehost
>geschlossen. (=An existing connection was closed by remote host)

Don't try to restore from a remote backup file, especially if your
network is subject to interruptions. Find a way to copy the backup
file across to your client machine and restore it locally.

>I could open the <localdatabase>.gdb and detected that all views,
>procedures, exceptions and triggers are missing. Tables, domains,
>indices have been restored properly.

If, indeed, your restore actually found the backup file that you
thought it would, then the restore has crashed because the connection
between your local instance of gbak and the remote backup file was lost.

>We use gbak version WI-V1.5.4.4910 Firebird 1.5.

Hopefully the database server is the same version, and the database
is ODS 10.1 or less...