Subject Re: Trouble with Gbak on Vista
Author Adam
--- In firebird-support@yahoogroups.com, "stewartwarren"
<stewartwarren@...> wrote:
>
> Thanks Adam,
>
> I've got two apps trying to access the firebird database. The main
> app accesses the db OK. I take that to mean the server is running OK
> and TCP port 3050 is not being block by a firewall.
>
> The second app is just a visual interface to gbak to give the user a
> button click approach to backups and restores. That's why the
> message "unavailable database" threw me. With Interbase, that
> message usually meant the Interbase server process was not running.
>

Are the connection strings identical? You are not allowed to have one
pointing to a local connection and another pointing to a TCP
connection. It could cause corruption in some cases.

> The backup app is not running gbak in its install directory, but in
> another directory where we manually copied the gbak.exe file to. We
> also manully copied the fbclient.dll file to the System32 directory.
>
> The gbak parameters were written for interbase 5.6 version of gbak
> which didn't accept long Windows filenames, as I recall. So gbak
> would be invoked as:
>
> gbak -B -b C:\Datdir~1\datafile.gdb C:\Datdir~1
> \Backups\backfil.bac -user uname -password theword

Do you mean -B -b ? Just one will do ;)

Your connection string is 'C:\Datdir~1\datafile.gdb' which implies a
local connection. That is probably why you are having trouble
accessing the database. Change it to [host]:[path]

>
> With the firebird version of gbak:
> Can it take the long filenames?

Yes (quoted if you have spaces obviously)

> Should I use the localhost or 127.0.0.1 as part of the file path?
>

I have found Vista sometimes tries to resolve an ipv6 address if you
connect to localhost. I have also seen a couple of servers where for
whatever reason, it needs to hit their dns servers to resolve
localhost. It is easy enough fixed adding a line to the hosts file,
but 127.0.0.1 is probably easier.

> For example, would this be correct:
> gbak -B -b localhost:C:\My LongDir Name\datafile.gdb localhost:C:\My
> LongDir Name\Backups\backfile.bac -user uname -pasword theword
>
> or maybe better as:
> gbak -B -b 127.0.0.1:C:\My LongDir Name\datafile.gdb 127.0.0.1:C:\My
> LongDir Name\Backups\backfile.bac -user uname -pasword theword
>

No, and I am surprised if this worked on IB.

* Remove one of the -b's
* Localhost / 127.0.0.1 is largely interchangeable.
* Use aliases rather than filenames
* If you must use filenames, quote any with spaces
* You don't use the hostname:path format for the backup file path.
* Don't give your database a gdb extension on Windows.

In aliases.conf, add line
Datafile=C:\My LongDir Name\datafile.fdb

then your gbak string is

gbak -b 127.0.0.1:Datafile "C:\My LongDir Name\Backups\backfile.bac"
-user uname -pasword theword

Or if you don't want to use aliases,

gbak -b 127.0.0.1:"C:\My LongDir Name\datafile.fdb" "C:\My LongDir
Name\Backups\backfile.bac" -user uname -pasword theword

Adam