How to migrate from old versions of InterBase?

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 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 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.

  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 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

  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.

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

Native v Hybrid v WebApp

I recently posted on my Embarcadero Blog about the 3 main types of mobile applications that developers write. Native apps, web-based mobile apps, and hybrid apps, and highlighted that you can achieve the benefits of both Hybrid development with a single code base to manage, test, and develop, with the SPEED AND SECURITY of TRUE native compilation. (Note, Not all development toolchains that claim to be native, compile everything!- Delphi does!)

Definitely worth sharing with those you know looking to choose which platform they want for their next development project.

Each approach has its Pro’s and Con’s, and with a view of how operating systems have developed over time, its easy to see how web-based technologies (web-native, and hybrid) have had a positive role to play in the adoption of multiple platforms by targeting the one thing each platform provides, a browser-based on HTML and open standard.

With OS vendors only interested in offering the best speed, performance, and usability via their own tools to aid adoption, and as OS’s evolve in different ways, (especially early in their development cycle) is understandable that choosing web can seem a good option to gain market entry with a broad access.

That said, we are now at a point where the market has matured. We have Apple and Google as the two key players covering over 99% of the market, pushing developers towards needing to maintain two codebases for the best user experience on mobile. On the other side, a number of web-based frameworks offering semi-native apps with a single code base.

What I love about Delphi, is that there is a unique offering enabling developers to benefit from a single code base that address both mobile platforms, with the speed, security and usability of Vender tools, PLUS the lower development cost, and low code options promoted by web/scripted frameworks.

FireMonkey is now 9 years old, and benefits from the best available compilers on the market, targeting the latest technologies (like Metal on iOS for blazing-fast rendering) and offers a choice of true native controls or platform styles controls at runtime.

Read more on my Embarcadero blog – What are the best options for mobile app development?