Bug 104957 - Embedded Firebird : conversion ODB files from Firebird 2.5 to Firebird 3.0 gives corrupted ODB files
Summary: Embedded Firebird : conversion ODB files from Firebird 2.5 to Firebird 3.0 gi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 51780
  Show dependency treegraph
 
Reported: 2016-12-28 11:01 UTC by ribotb
Modified: 2017-01-06 13:22 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
conversion (52.17 KB, application/zip)
2016-12-28 11:30 UTC, ribotb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ribotb 2016-12-28 11:01:41 UTC
Version 5.3 cannot read data from Firebird 2.5, therefore odb files embedding firebird and created up to version LibreOffice 5.2 (incompatibility between firebird 2.5 used until LO 5.2 and Firebird 3.0 used by LO 5.3

ODB files embedding Firebird 2.5 (up to JO 5.2) not compatible with LO 5.3 (embedding Firebird 3.0)

I'm trying the file conversion procedure (while waiting for compatibility) but I'm having a problem.

The Gbak that I wrote seems to work, but after replacing firebird.fdb file by firebird.fbk file (created by gbak 2.5) in the odb database, LO 5.3 can not open the database odb because "file corrupted".

I have done the manipulations of the odb file with 7-Zip. 

Gbak (Win7/x86): 

"C:\Program Files\Firebird\Firebird_2_5\bin\gbak.exe"  -verbose -y %USERPROFILE%\Desktop\gbak.log -user SYSDBA -password masterkey -convert  localhost:%USERPROFILE%\Desktop\firebird.fdb %USERPROFILE%\Desktop\firebird.fbk 

Gbak execution report :

gbak:readied database localhost:C:\Users\Bernard\Desktop\firebird.fdb for backup
gbak:creating file C:\Users\Bernard\Desktop\firebird.fbk
gbak:starting transaction
gbak:database localhost:C:\Users\Bernard\Desktop\firebird.fdb has a page size of 4096 bytes.
gbak:writing domains
gbak:    writing domain RDB$1
gbak:    writing domain RDB$3
gbak:writing shadow files
gbak:writing character sets
gbak:writing collations
gbak:writing functions
gbak:writing tables
gbak:    writing table Table1
gbak:         writing column lib
gbak:         writing column ID
gbak:writing types
gbak:writing filters
gbak:writing id generators
gbak:writing stored procedures
gbak:writing exceptions
gbak:    writing index RDB$PRIMARY1
gbak:    writing data for table Table1
gbak:2 records written
gbak:writing triggers
gbak:writing trigger messages
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user PUBLIC
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user PUBLIC
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user PUBLIC
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:    writing privilege for user 
gbak:writing table constraints
gbak:writing constraint INTEG_1
gbak:writing constraint INTEG_2
gbak:writing referential constraints
gbak:writing check constraints
gbak:writing SQL roles
gbak:writing names mapping
gbak:closing file, committing, and finishing. 2048 bytes written
Comment 1 ribotb 2016-12-28 11:30:13 UTC
Created attachment 129983 [details]
conversion
Comment 2 m.a.riosv 2016-12-29 23:33:38 UTC
Please take a look to:
http://nabble.documentfoundation.org/Firebird-backward-incompatibility-tt4201036.html

I think you need to do a backup with a gbak of 2.5 firebird version, and also restore from the backup with a gbak of 3.0 firebird version.

In Spanish but here is a blog on how to do.
https://firebird21.wordpress.com/2016/05/21/firebird-3-usando-bases-de-datos-anteriores/
Comment 3 ribotb 2016-12-30 10:43:57 UTC
(In reply to m.a.riosv from comment #2)
> Please take a look to:
> http://nabble.documentfoundation.org/Firebird-backward-incompatibility-
> tt4201036.html
> 
> I think you need to do a backup with a gbak of 2.5 firebird version,
> 

I have a Firebird 2.5 Server installed on my PC. Therefore the archive file (firebird.fbk) is created with gbak 2.5.

> and also restore from the backup with a gbak of 3.0 firebird version.
> 
Why a restore of the archive file (firebird.fbk)? It's this archive file that must be embedded in the odb file to replace the firebird database (firebird.fdb).

What is wrong?
Comment 4 m.a.riosv 2016-12-30 21:45:41 UTC
(In reply to ribotb from comment #3)
> Why a restore of the archive file (firebird.fbk)? It's this archive file
> that must be embedded in the odb file to replace the firebird database
> (firebird.fdb).
> 
> What is wrong?

Please forgive, I was thinking on an ordinary firebird database.
Comment 5 Alex Thurgood 2017-01-05 15:48:59 UTC
@tamas : is there some confusion here as to what needs to be done ?
Comment 6 Lionel Elie Mamane 2017-01-05 17:58:23 UTC
The "corrupted" message is because the manifest (META-INF/manifest.xml in the .odb ZIP structure) becomes inconsistent with the actual contents.

Need to either update the manifest, or indeed do a restore to .fdb in a Firebird 3.0 (which will happen to work...) and include a 3.0 fdb and no fbk (LibreOffice will convert it to a fbk).

To update the manifest, just replace within it:
  <manifest:file-entry manifest:full-path="database/firebird.fdb" manifest:media-type=""/>
by
  <manifest:file-entry manifest:full-path="database/firebird.fbk" manifest:media-type=""/>
Comment 7 Alex Thurgood 2017-01-06 10:54:54 UTC
Per Lionel's comment setting to new. Another thing that we would need to deal with if we have some kind of automatic converter set up one day.
Comment 8 ribotb 2017-01-06 11:44:08 UTC
(In reply to Lionel Elie Mamane from comment #6)
> Need to either update the manifest, 
>
> To update the manifest, just replace within it:
>   <manifest:file-entry manifest:full-path="database/firebird.fdb"
> manifest:media-type=""/>
> by
>   <manifest:file-entry manifest:full-path="database/firebird.fbk"
> manifest:media-type=""/>

Hi,

It works fine!

In french "C'était simple et il suffisait d'y penser !" :-))

Thanks, Lionel!

Perhaps, add that to the release notes ?

Bernard
Comment 9 Lionel Elie Mamane 2017-01-06 12:41:04 UTC
I'd say just update the conversion instructions (on the wiki?) and then close this bug.
Comment 10 ribotb 2017-01-06 13:22:46 UTC
(In reply to Lionel Elie Mamane from comment #9)
> I'd say just update the conversion instructions (on the wiki?) and then
> close this bug.

Yes, for me.