Migrating a 6.10.1 server with no FLY_HFJ_MIGRATION table?

19 views
Skip to first unread message

Hank Wallace

unread,
Jan 5, 2025, 4:02:45 PMJan 5
to HAPI FHIR
How do you use the hapi-fhir-cli migrate-database command when there is no existing FLY_HFJ_MIGRATION table?

We have servers based on the hapi-fhir-jpaserver-starter project. We are attempting to upgrade them from v6.10.1 to v7.4.0. The schemas for them were initially created by using the automatic schema creation ability of the server, so they don't have a FLY_HFJ_MIGRATION table.

If I run the hapi-fhir-cli migrate-database command, it runs migrations for versions much earlier than 6.10.1. I see the --skip-versions argument but that's difficult, if not impossible, to use when I need to skip a very large number of migrations.

How do I skip all of the migrations prior to the version used to initialize a schema?

For the future, is there a better practice for initializing the schema for a new server?

Thanks,
Hank


Jean-Francois Briere

unread,
Aug 24, 2025, 3:47:14 PM (14 days ago) Aug 24
to HAPI FHIR
I have the same question using the  hapi-fhir-cli migrate-database command without the FLY_HFJ_MIGRATION table.

What is the strategy to update the server when it was initially created from a HAPI version > 3.3.0 by using the automatic schema creation ability, so without the creation of the  FLY_HFJ_MIGRATION  table?

I think  that the only way to achieve such upgrade are the following steps :
- Start an older temporary HAPI server version 3.3.0 from an empty temporary database;
- Execute on the temporary database the hapi-fhir-cli migrate-database command with the older hapi-fhir-cli .jar version 6.10.1;
- Export the created FLY_HFJ_MIGRATION table from the temporary database a SQL script with table creation and data inserts.
- Execute the SQL script of the FLY_HFJ_MIGRATION table creation and data inserts to the target database version  6.10.1;
- Execute on the target database the hapi-fhir-cli migrate-database command from the  hapi-fhir-cli .jar version 7.40.0;

Is there another way?
Reply all
Reply to author
Forward
0 new messages