1

We have a .gbk file that we are trying to restore to a database, in order to convert it to Postgres, but we can’t figure out the ODS or even if it is actually an Interbase file, and not a Firebird file.

We ran downloaded gbak version UI-V3.0.10.33601 Firebird 3.0 and restored it. Running gstat on the resulting file gives us:

Database header page information:
    Flags           0
    Generation      1814
    System Change Number    0
    Page size       16384
    ODS version     12.2
    Oldest transaction  1803
    Oldest active       1804
    Oldest snapshot     1804
    Next transaction    1804
    Sequence number     0
    Next attachment ID  9
    Implementation      HW=AMD/Intel/x64 little-endian OS=Darwin CC=gcc
    Shadow count        0
    Page buffers        0
    Next header page    0
    Database dialect    1
    Creation date       Jan 19, 2024 23:35:51
    Attributes      no reserve

    Variable header data:
    Sweep interval:     0
    *END*

Trying to open it with DBeaver on a Mac (as Firebird):

I/O error during "open" operation for file “myfilename”; Error while trying to open file; Operation not permitted [SQLState:08001, ISC error code:335544344]

Trying to open it with DBeaver on a PC (as Firebird):

unsupported on-disk structure for file “myfilename”: found 32780.18, support (null) (null)

I presume this means it expected 18, and I read that 32779, that is 1 lower than ours, indicates that i is a Firebird 2.x file. Is it a Firebird file because we used gbak as supplied by Firebird? It is the only version we got to work.

Trying with Interbase 2020 togo installation (PC)

gstat on the gdb file:

Wrong ODS version, expected 18, encountered 32780

Also, running gbak on our gbk file that we started with gives:

gbak: ERROR: Expected backup version less than or equal to 7. Found 9

So in summary we can’t figure out what is going on at all, it’s not clear if the file is too new or too old, or even if it is Firebird or Interbase. What is the right approach?

1
  • Why you didn't just ask database owner? Commented Jan 20 at 12:48

1 Answer 1

1

According to the message "Expected backup version less than or equal to 7. Found 9" this backup file was made by Firebird gbak version 2.5. You can restore it on any Firebird server version 2.5 or higher.

The errors you get trying to connect to database on Mac is not related to database format but to file system permissions (not necessarily for the database file itself, it may be problem with temporary files as well). You can solve them using remote connection string instead of embedded and/or adjusting permissions on involved files.

The error you get trying to connect to the database on PC imply that you simply copied the file from Mac which is no go because database file is platform-dependent. You can solve it by restoring the backup file on PC to create a suitable database.

The error you get trying to restore Firebird backup using Interbase is caused by fact that Firebird and Interbase are different SQL servers even though they had common ancestor. You cannot solve it.

4
  • Thanks a lot, that clarified things a lot. Now I used the gbak that comes with Firebird 3, on the PC, and the restoration seemed to work. Trying to open it with various GUI tools like RazorSQL still fails with version complaints, but isql (from Firebird) instead complains about a missing F_YEAR function, which I presume means it got past the version issues. I copied the UDF file to the UDF folder, but that didn't help. Still, a large step forward! Commented Jan 21 at 9:29
  • @NilsNielsen Usage of UDFs is disabled by default config in Firebird 3 IIRC. Also you must take care about bitness of the library. Commented Jan 21 at 14:06
  • Thank you. Yes I found and changed the UDF setting to "Full", but alas that does not help. I copied both a 32 bit and a 64 bit version. I have seen many others have the same issue, but most of them resolved it by simply copying the FreeUDFLib into UDF/, which does not help me. A lot of them talk about "installing" UDFs, but I can't find any information about what that would entail. PS also checked that the gds32.dll file is present. Commented Jan 22 at 19:14
  • @NilsNielsen Then you should try to use Process Monitor to examine process of library load to find out exact reason for failure. In any case it is completely different issue. Commented Jan 22 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.