Gettting s backup file (ods )version

92 views
Skip to first unread message

Tommi Prami

unread,
Sep 14, 2022, 3:27:55 AM9/14/22
to firebird-support
Yellow,

I've treid how to get ods-version _only_ of backup. Can minimize restore it elf by restoring the metadata only, but it takes quite a while still.

Little background. If our appo starts to do a restore, it needs to know is original backup 2.5.x or fb4.x or newer (for now at least). If it is older backup, made with FB2.5 I need to find out that before restore, so I can switch process/code path, and then restore it with fb2.5 embedded, and then do database structure update, so it is compatible with FB4+

I could do it with something like :

gbak -replace fb25x.fbk unique_temp_db_name.fbd -z -meta_data

And get what gbak echoes into the "Command prompt", and parse ods-version from that, it just takes a few seconds to find out, which I would hope it to take only millisecond or maybe few.

Is there a solution for that? if not, maybe make such a feature for FB 5x

-Tee-


Сергей Волков

unread,
Sep 14, 2022, 3:53:19 AM9/14/22
to firebird...@googlegroups.com
Hi.
The description of the headers of the backup file in kaitai format is here. With kaitai struct compiler, they can be converted into a class for a programming language. Usage example in view_gbak.py.
Also read 1 byte at offset 3 (usually there is a version). 
Version matching (firebird / backup format):
2.5 = 9
3.0 = 10
4.0 = 11

ср, 14 сент. 2022 г. в 10:27, Tommi Prami <tommi...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/CABwd-aq4BfKwPCiWOZfj2MEN47MfLgKMg_kcMg8i%3DGmF6CsPRA%40mail.gmail.com.

Tommi Prami

unread,
Sep 14, 2022, 5:44:41 AM9/14/22
to firebird...@googlegroups.com
Thanks... 

Can someone make C-structure with that Python thingy, might take quite a while to install and learn how to use it... I could then port it to my needs (Delphi/Pascal, maybe)

That Offset byte could be enough...

-Tee-

Reply all
Reply to author
Forward
0 new messages