How to migrate from old versions of InterBase?

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,203
Credits
4,034
How to migrate from old versions of InterBase?
March 17, 2021 by Stephen Ball

I got a question this week about how to migrate from an old version of InterBase to the latest version, so I thought I would share a few tips and hints on how to move data forward from old versions.

InterBase On Disk Structure​

Before we start, it is important to know that each major release of InterBase has an associated Для просмотра ссылки Войди или Зарегистрируйся

When database files are restored on created with the latest ODS it enables InterBase to make features available for use with that database file. If you don’t use the latest ODS format, then features in the InterBase engine may not be available to that database file.

INTERBASE VERSIONPRIMARY ODS VERSION
202018
201717
XE716
XE315
XE15
200913
200712
7.011
6.010
5.5/5.69.1
5.0/5.19
One benefit of InterBase today is that the ODS is cross-platform, meaning the same database file can be moved between Windows, macOS, iOS, Android, and Linux without modification, drastically simplifying the development and maintenance of data in cross-platform/multi-platform applications.

What is the InterBase migration process?​

For most cases, the InterBase migration progress follows 4 simple steps:
  1. Backup all the databases to be migrated.
  2. Install the latest InterBase server.
  3. Restore the databases being migrated on the most recent version
  4. Validate migrated databases.
When migrating from a version using ODS 13 or newer, this should be enough to get updated. If you are using an older ODS, then there are a couple of more steps to get updated.

The only other checks to make when updating are for are new Для просмотра ссылки Войди или Зарегистрируйся in InterBase. These are occasionally added to support new features, such as table truncation, or ChangeViews. A full list of keywords is available on Для просмотра ссылки Войди или Зарегистрируйся

How to migrate from very old versions of InterBase?​

If you are using a version prior to InterBase 2009, then there are two options available to you.
  1. Migrate to an intermediary version first (that supports ODS 13 or above)
  2. Move the data to a new database created in the latest version.

Migrating to an intermediary version​

As an example, a backed-up version of an InterBase 5 database could be restored using InterBase 2007 (to create an InterBase database file that uses ODS 12). The new database file can then be backed up in InterBase 2007 to a backup that supports ODS 12. InterBase 2020 can actually read ODS 11 and 12 for backup purposes only, so from here you can restore to the latest version.

Prior to the release of InterBase 2007, a number of new Для просмотра ссылки Войди или Зарегистрируйся were added to InterBase. By targeting InterBase 2007 first, you can also locate any issues around keywords prior to the bigger jump to ODS 18 (InterBase 2020)

Moving data from an old to a new database​

The other option is to use a data pump tool to move the database from an old database to a newer version. This can be more complicated due to foreign key constraints, however, there are specialist tools such as InterBase DataPump that can be used for this process.

Для просмотра ссылки Войди или Зарегистрируйся

If you choose to go this path, then the basic steps are to
  1. Create a blank new database in the latest version
  2. Save the metadata from the existing database, and use it as a script to add the structure to the new database file
  3. Pump in the data: Making allowance for
    • the order data is moved based on Foreign key constraints
    • table triggers (best to disable these first)
  4. Reset database generators to the required value

External Dependencies​

Another things to check when migrating to newer InterBase versions are any external dependancies. (e.g. User Defined Libraries (UDF) that you use). Older versions of InterBase could have been 32bit only.

As 32bit and 64bit libraries are incompatible with each other, an initial upgrade route would be to get to the latest version of InterBase on 32bit, and then look to get a 64bit version of the UDFs for use with a 64bit version of InterBase. As the ODS is the same for all InterBase platforms, this is then a seamless migration.