Search code examples
firebirdfirebird2.5

Firebird 2.5 database restore using gbak and fix_fss_data returns Malformed string


I have an old database and I want to convert it to Firebird 2.5. A problem occurs when restoring the data on tables which contains blob text fields with the well know issue "gbak: ERROR:Malformed string gbak:Invalid data detected"

Steps performed:

  1. gfix -user SYSDBA -password masterkey f:\dbb.db -shut -force 0
  2. gfix -v -full -user SYSDBA -password masterkey f:\dbb.db
  3. gbak -v -t -g -ig -user SYSDBA -Y F:\backup.log -password "masterkey" f:\dbb.db F:\dbb1.db
  4. gbak -r -v -o -p 16384 -Y F:\log.txt -user SYSDBA -password masterkey "f:\dbb1.db" "f:\new.db" -fix_fss_data win1251 -rep

replacing the character set with win1252,utf8 or unicode_fss does not solve the problem.

I have also tried to migrate the data by using InterBase Data Pump version 3.4.

Steps:

  1. backup the metatable
  2. restore the metatable on a new database
  3. migrate the data by using InterBase Data Pump

Errors encountered "Malformed string".

All the tables on which the error occur have a field of type "BLOB SUB_TYPE 1 SEGMENT SIZE 80"

I suspect that at the beginning the database had the charset WIN1252. After that someone changed the charset to UTF8 and changed all the fields definition for charset and collate from WIN1252 to UTF8. Otherwise I do not understand why I get these malformed string errors. Also, I understood that this problem is common to FireBird 2.0 to FireBird 2.5 migrations.

Does anybody have an idea on how to solve this?


Solution

  • even it sounds stupid, I fixed it in this way:

    backup the metatable
    create an restore to a new database file
    extract the data from old table by using IBExpert into a script
    run the script to add data the new database

    None of the combinations of -fix_fss_D or fix_fss_m with different charsets did not import all the data into the new database. Tried all the free and shareware tools without results.