#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0

    Firebird migration ODS issue


    Hi,
    I tried to migrate an Interbase database to a Firebird 2.5 instance but I'm in trouble with the ODS format used on the origin database. If I run the gstat command on Interbase server I can notice that the database uses the ODS 12 version and I can't import this database on Firebird 2.5 version.

    Are there some method to import this database?

    I have also tried the Firebird 3.0 Alpha 1 version but the behavior is the same.

    Thanks a lot,
    Marcello
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Location
    Plovdiv. Bulgaria
    Posts
    226
    Rep Power
    12
    Firebird's ODS and Interbase's ODS are different. Try to export the data as SQL script and import it in new, empty Firebird database. IBExpert has such tools.
    And maybe you'll have to change some things in the script if they are not supported in Firebird.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by mIRCata
    Firebird's ODS and Interbase's ODS are different. Try to export the data as SQL script and import it in new, empty Firebird database. IBExpert has such tools.
    And maybe you'll have to change some things in the script if they are not supported in Firebird.
    Thanks for the reply. I have tried to export the database from Interbase to Firebird as suggested in transporable format, and the import worked as expetected. The tables are visibile.

    If i tried to run a backup/restore from Firebird to Firebird, I noticed an error during the imort phase.

    Could this behavior be related to the ODS difference?

    Thanks,
    Marcello
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Location
    Plovdiv. Bulgaria
    Posts
    226
    Rep Power
    12
    What is the error?
    And what are the versions of both Firebirds?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0
    I tried the backup situation on the same firebird instance after the moving from Interbase. The server has been installed with firebird-superserver version 2.5.2.26539 on CentOS 6 x86_64.

    The status of the imported database on FB is:

    Code:
    Database: /var/lib/firebird/data/test.fdb
            Owner: SYSDBA                         
    PAGE_SIZE 8192
    Number of DB pages allocated = 86400
    Sweep interval = 0
    Forced Writes are ON
    Transaction - oldest = 72
    Transaction - oldest active = 73
    Transaction - oldest snapshot = 73
    Transaction - Next = 77
    ODS = 12.0
    Default Character set: NONE
    I received an error about the violation of primary key into an index.

    Code:
    gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "RDB$INDEX_12" on table "RDB$RELATION_CONSTRAINTS"
    gbak:Exiting before completion due to errors
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Location
    Plovdiv. Bulgaria
    Posts
    226
    Rep Power
    12
    This error shows that somehow you have 2 or more constraints (primary key, foreign key, check etc) with duplicate names.
    Execute this
    Code:
    SELECT
         RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME,
         COUNT(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME)
     FROM
         RDB$RELATION_CONSTRAINTS 
    GROUP BY 1 
    HAVING COUNT(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME)> 1 
    ORDER BY 1
    This will show you the duplicates. And if they are not with RDB$* (system constraints) you have to change/remove them before the backup.

IMN logo majestic logo threadwatch logo seochat tools logo