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 On-Disk Structure (ODS).
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 version | Primary ODS version |
---|---|
2020 | 18 |
2017 | 17 |
XE7 | 16 |
XE3 | 15 |
XE | 15 |
2009 | 13 |
2007 | 12 |
7.0 | 11 |
6.0 | 10 |
5.5/5.6 | 9.1 |
5.0/5.1 | 9 |
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:
- Backup all the databases to be migrated.
- Install the latest InterBase server.
- Restore the databases being migrated on the most recent version
- 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 keywords in InterBase. These are occasionally added to support new features, such as table truncation, or ChangeViews. A full list of keywords is available on docwiki
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.
- Migrate to an intermediary version first (that supports ODS 13 or above)
- 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 keywords 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.
https://clevercomponents.com/products/datapump/index.asp
If you choose to go this path, then the basic steps are to
- Create a blank new database in the latest version
- Save the metadata from the existing database, and use it as a script to add the structure to the new database file
- Pump in the data: Making allowance for
- the order data is moved based on Foreign key constraints
- table triggers (best to disable these first)
- 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.
Where to download the latest InterBase version?
The Latest version of InterBase is available from Embarcadero.com with a Developer Edition (which offers light database encryption only) or Trial Edition (includes strong encryption at rest on disk). For older editions of InterBase to help with migration, please contact Embarcadero sales
One thought on “How to migrate from old versions of InterBase?”