Subject Re: [firebird-support] Gbak restore errors with Vista Business
Author Helen Borrie
At 04:34 AM 2/05/2008, you wrote:
>I have run into some errors while trying to restore a firebird
>database. Firebird is running as a service. The backup worked great
>with the loop back in the path, but the restore has been a pain.
>With: gbak.exe -c -page 8192 "C:\ Path\DB.fbk" " C:\ Path\DB.fdb" -
>user "SYSDBA" -password "masterkey"
>It returns the error: unavailable database.
>With: gbak.exe -c -page 8192 "\ Path\DB.fbk" " C:\
>Path\DB.fdb" -user "SYSDBA" -password "masterkey"
>Returns the error: gbak: ERROR: Cannot open backup file\
>I have tried:
>gbak.exe -c -page 8192 "\ Path\DB.fbk" …,
>gbak.exe -c -page 8192 "PC's IP:C:\ Path\DB.fbk"…,
>gbak.exe -c -page 8192 "localhost:C:\ Path\DB.fbk"…,
>gbak.exe -c -page 8192 "PC's name:C:\ Path\DB.fbk"…
>All return the same error: ERROR: Cannot open backup file …
>Has anyone else experienced this and found a work around?

The backup file isn't a database so, to open it, you need a file path, not a database connection string. Because you're trying localhost one assumes that the client program (gbak) and the backup file and the restore location are all on the same machine and that you (windows user) have privs to c:\path in order to open the backup file.

gbak -c -page 8192 c:\path\DB.fbk localhost:c:\path.fdb -user sysdba -password masterkey

If localhost doesn't work (because you're running gbak from a RDT client) then replace it with the machine's IP address (if it is static) or its hostname (if it's not).

Quotes - you will need these around the connection string for the restored database *if* there are spaces in the path name, otherwise no quotes anywhere.

BTW, the 'unavailable database' message (first example) usually means either the Firebird server isn't running or that you're trying to access (or create) a database under a sub-V.2 Classic server - for which the IPServer protocol is not valid.