Migrating from AWS HealthLake to HAPI FHIR

Moving from AWS HealthLake to a self-hosted HAPI FHIR JPA server means exporting data, rebuilding the services HealthLake provided and running both systems through cutover. This page covers what maps, what does not and what drives effort.

On this page

How to migrate from AWS HealthLake to HAPI FHIR without losing data or access

The data move is usually the smaller part of leaving AWS HealthLake. The larger effort sits in replacing the features HealthLake manages for you, such as its hosted FHIR endpoint, its authentication integration and its operational tooling, and in proving that the self-hosted server answers the same questions with the same results. Plan the migration as two workstreams from the start: one that moves the resources, and one that rebuilds the behavior your applications depend on and checks it against HealthLake before anyone switches traffic.

The data path runs from a $export operation on the HealthLake data store to newline-delimited JSON (ndjson) files in S3, then through a transform and load step into a HAPI FHIR JPA server that you run in your own cloud account or data center. The JPA server is the component that stores resources in a relational database, and the starter can be deployed in several ways, including Docker, Kubernetes with the Helm chart, or as a WAR on an application server. Decide early which FHIR version your data uses and confirm that the HAPI FHIR release you select supports it, since the JPA server covers DSTU2 through R5. Confirm the JDK requirement for your chosen release as well, because HAPI FHIR 8.2.0 requires JDK 17 and later releases may differ.

Inventory what HealthLake does for your applications before you copy anything. That usually includes the SMART-on-FHIR or IAM-based authorization in front of the endpoint, search behavior your clients rely on, the way your teams call bulk operations, and any logging or audit trail you keep. Each item needs an owner on the HAPI FHIR side, such as the AuthorizationInterceptor, the BALP audit logging, or your own gateway. The HAPI FHIR security documentation states there is no single security layer in the box, so plan these controls as deliberate work. Run both systems in parallel for a period and compare results for a representative set of queries before cutover. Ask your team to confirm the exact export format, retention and any HealthLake-specific fields that must survive the transform.

Which HealthLake capabilities map to HAPI FHIR and which need new design

This table compares the HealthLake capabilities your team uses with the closest HAPI FHIR JPA server equivalents, and marks where HAPI FHIR provides building blocks rather than a finished replacement. Read each row against your own HealthLake configuration, since parity depends on settings in your account that you need to confirm before assuming a match. Rows marked as design work are where most of the migration effort tends to sit.

CapabilityHealthLake (confirm in your account)HAPI FHIR JPA serverStatus
FHIR REST APIManaged FHIR endpoint for the data store's FHIR version; confirm the version and supported interactions for your storeRESTful FHIR server backed by a relational database, covering DSTU2, DSTU3, R4, R4B and R5Direct equivalent after version check
Resource storageManaged storage with service-defined sizing and backups; confirm retention and recovery settingsResources stored in PostgreSQL or Microsoft SQL Server; you size, back up and tune the databaseNew design: you own storage and backup
Bulk export$export writes ndjson files to S3; confirm the output location, file layout and encryption keyBulk export is available in the server, but output location and file layout must be checked against your transform stepBuilding block: validate output
AuthenticationIAM and SigV4-based access to the endpoint; confirm which principals and policies call it todayAuthentication interceptors you wire to an external identity provider; no single built-in security layerBuilding block: new design
AuthorizationResource-level access through IAM policies; confirm which actions each role holdsAuthorizationInterceptor and search narrowing interceptors, configured per resource and compartmentBuilding block: rules must be rewritten
SMART on FHIR and IAM integrationConfirm whether apps use SMART launch or only IAM credentialsRequires an OAuth2/OIDC provider and SMART scope mapping built by your teamNew design
Audit loggingCloudTrail and HealthLake logging; confirm which events your auditors requireBALP audit logging is available as a building block; mapping events to your audit schema is your taskBuilding block: confirm coverage
Supported FHIR versionsConfirm the FHIR version of your data store and any profiles in useMultiple FHIR versions supported by the server; profile and search parameter parity must be testedDirect equivalent after testing

Documented export and import paths for moving HealthLake data

Moving data out of HealthLake and into a HAPI FHIR JPA server uses documented interfaces at each end, with a gap in the middle that your team must fill. The cards below trace each documented path, where it stops, and where transform code and checks are needed.

FHIR $export to S3

HealthLake's FHIR $export operation writes resources as ndjson files to an S3 location you specify. Confirm in the HealthLake documentation which export scope, resource types and output options your data store supports, and confirm the bucket permissions and KMS key the job needs. The export ends at the files: it does not load anything into HAPI FHIR, and it does not check that the files are complete.

Transaction bundles on the load side

The HAPI FHIR JPA server accepts FHIR transaction bundles over its REST API, so one documented load path is to convert ndjson records into bundles and POST them. Your team writes the converter, decides how IDs and references are preserved, and sets the load order so referenced resources exist first. The server validates and stores what it receives; mapping HealthLake-specific fields is your work.

JPA server docs

Starter deployment options

The JPA server starter can run as the hapiproject/hapi Docker image, through Docker Compose, under Spring Boot, as a WAR on Tomcat, Jetty or Wildfly, or on Kubernetes with a Helm chart. Pick one option before the load tests start, because batch size, memory and connection limits behave differently in each. Test the chosen option with a representative export, not a small sample.

Starter repository

PostgreSQL or SQL Server for production

The starter defaults to an embedded H2 database, which is not a production choice. PostgreSQL and Microsoft SQL Server are the supported production databases, and MySQL is not supported. Decide the database early, because schema, storage sizing and backup procedures follow from it, and a migration onto the wrong engine means reloading everything.

Where custom transform code is needed

The documented paths do not cover HealthLake-specific details, such as resource identifiers that must be kept, extensions the target profiles require, or references that point across resource types in a different order. Expect custom code for these, and ask a partner or vendor to confirm which fields your data needs. Keep the transform code under version control so each load run can be reproduced.

Scope of this page

This page uses only documented export, load, deployment and database paths. It does not describe undocumented HealthLake internals or any tool outside the supplied sources. Where a step depends on your own data, your HealthLake configuration or your security policy, the page names what to confirm rather than assuming an answer.

How the export, transform and load path fits together

The path has four stages: HealthLake runs a FHIR $export operation that writes NDJSON files to an S3 bucket you control, a transform step reshapes those files into loadable form, the HAPI FHIR JPA server ingests them through its API, and the relational database behind the server stores the result. Each stage has a different failure mode, so the team should treat them as separate checkpoints rather than one copy job. The export is the only stage that reads from HealthLake, which means the source system's export window and access permissions set the boundary for everything downstream. Confirm the export scope (all patients, a group, or a set of resource types) in writing before anyone builds the transform, because a narrower export will look like data loss later.

Identifiers and references decide whether the loaded data is usable. Every resource in the NDJSON files carries a logical ID, and other resources point to it with references such as Patient/123 in fields like subject or patient. HAPI FHIR assigns and resolves these references during load, so a referenced resource that has not been written yet will fail or leave a dangling link. Decide early whether IDs are preserved as-is, which is the simpler path for cutover, and make sure the transform does not rewrite them. Load order matters for the same reason: patients and other foundational resources should land before the observations, encounters and claims that point at them. The NDJSON files are not organized to guarantee that order, so the loader needs an explicit sequence.

Count checks are the cheapest way to catch a bad load. After each load, compare the number of resources per type in the export manifest and NDJSON files against the count returned by HAPI FHIR for that type, and record any mismatch with the resource type and file name. Counts alone do not prove that references resolved or that content matched, so pair them with spot checks on a sample of resources. Note that HealthLake and HAPI FHIR can differ on whether a count includes deleted or historical versions, so confirm how each system reports counts before you set a pass threshold. Keep the count report with the migration run record, since it is also the evidence a reviewer will ask for when the cutover is signed off.

The migration sequence from inventory to decommissioning HealthLake

The sequence moves a HealthLake data store to a self-hosted HAPI FHIR JPA server in stages, with each stage producing evidence that the next one can rely on. Decommissioning happens last, only after parity, parallel running and the retention and audit needs are confirmed.

  1. Inventory resource types, profiles and client dependencies

    Your team and the migration lead list the resource types stored in HealthLake, the profiles and extensions in use, the search parameters clients call, every application that reads or writes data, and the authentication flows those applications use. HealthLake features in use, such as its managed SMART on FHIR setup, its IAM policies and any notifications or analytics tied to the store, go on the same list. The output is a written inventory with an owner for each item. The step closes when the owners agree that the inventory is complete and that each gap is either assigned to a workstream or explicitly accepted as out of scope.

  2. Run a pilot export and load into non-production

    Start a FHIR bulk export from a copy or a subset of the HealthLake data store, write the ndjson files to S3, and load a representative sample into a non-production HAPI FHIR JPA server. Use the same HAPI FHIR version you plan to run in production, and confirm its Java requirement (JDK 17 for HAPI FHIR 8.2.0) before the environment is built. The pilot shows which resource types fail validation, which references break and how long the load takes on your hardware. It closes when the pilot load runs without unexplained errors and the team has a documented load procedure.

  3. Transform and load the full dataset

    Apply any transformations needed to meet the target configuration, such as profile conformance fixes, identifier mapping or partition assignment if you use HAPI FHIR JPA partitioning. Then load the complete export in dependency order so references resolve, and keep IDs stable so clients do not need remapping. The load is repeatable from the same export files. The step closes with a count reconciliation: the number of resources per type in HAPI FHIR matches the export manifest, and any exceptions are listed with a decision on each.

  4. Test search and client call parity

    Run the inventory of search parameters, read and search calls, and paging behavior against both HealthLake and HAPI FHIR using the same test cases. Compare result sets, included resources, sort order and error responses, and check that each application's authentication flow works against the new authorization setup. Record every difference as a defect, a client change or an accepted behavior change. The step closes when every critical client call passes, and the owners of each dependent application have signed off on the remaining differences.

  5. Run both systems in parallel

    Keep HealthLake as the system of record while selected clients read from HAPI FHIR, or run the write path to both stores where that is feasible for your design. Monitor error rates, latency and data drift between the stores, and reconcile differences on a fixed schedule. Parallel running exposes issues that only appear under real traffic and real workflows. The step closes when the agreed observation period has passed with no unresolved data drift and the operations team is comfortable running the new platform on its own runbooks.

  6. Cut over clients to HAPI FHIR

    Switch the remaining clients to the HAPI FHIR endpoint, update their configuration and credentials, and make HAPI FHIR the system of record for new writes. Freeze writes to HealthLake during the final delta load, then load the changes made since the last export. Keep a documented rollback path to HealthLake until the cutover is verified. The step closes when all clients use HAPI FHIR, the final delta reconciles against the source, and rollback is no longer needed under the approved change plan.

  7. Decommission HealthLake after retention and audit checks

    Before deleting the HealthLake data store, confirm with your compliance and legal owners which records must be retained, in what form, and for how long, and confirm which audit logs from HealthLake must be kept or exported. Store the final export and audit records in storage you control, verify they can be read, and then remove HealthLake resources and related IAM roles. This step does not close on a date. It closes when the compliance owner signs off on the retained copies and the audit evidence, and the decommissioning record is filed.

How the HealthLake, S3, transform and HAPI FHIR components connect

The flow starts in the AWS account, where the HealthLake data store runs a $export operation that writes NDJSON files to an S3 bucket. Those files cross into infrastructure the client controls, where a transform and load stage turns them into transaction bundles for the HAPI FHIR JPA server and its PostgreSQL or SQL Server database. During the parallel run, both systems receive writes from client applications, so check that each write path is named and that the two stores are reconciled at cutover.

Data and write paths across the AWS trust boundary during the parallel run.

Running HealthLake and HAPI FHIR side by side during cutover

Before the parallel run starts, the team must choose and document the write path: either HealthLake stays the single source of truth until cutover and HAPI FHIR receives a one-way copy, or HAPI FHIR takes writes for a defined set of clients while HealthLake is kept in sync. The choice decides everything else. A one-way sync means the export and load pipeline runs on a schedule and every client keeps writing to HealthLake, so the HAPI FHIR data is only as current as the last load. Two-way writes require conflict rules for the same resource changed in both systems, and most teams find those rules hard to get right. Write the decision, the owner and the reasons into the cutover plan before any client is pointed at HAPI FHIR.

Assign each client application a named system of record during the run. Read-only consumers such as reporting jobs and analytics extracts can move first, because a difference in their output is easy to trace. Clients that create or update resources should move last. Confirm with the vendor and in your own account how HealthLake's $export behaves: whether exports are complete snapshots, how long exported files remain in the S3 bucket, which KMS key encrypts them, and what retention applies to the data store itself. Those answers set the reconciliation window, because if exported files expire before a comparison finishes, the comparison cannot be repeated.

Reconciliation compares counts by resource type, then compares sampled resources field by field, then reruns the search queries your clients depend on against both servers and compares the result sets. Differences usually come from search parameter behavior, reference handling, extensions or profile validation rather than lost data, so record each difference with its cause. The cutover checklist should confirm that counts match or each gap is explained, that critical searches return equivalent results, that authentication and SMART scopes work for every client on HAPI FHIR, that audit logging is active, and that a rollback path to HealthLake is tested and timed. Traffic moves only when the owner signs off on this list.

What drives the cost and duration of a HealthLake to HAPI FHIR move

This table lists the main factors that change the effort and cost of moving from AWS HealthLake to a self-hosted HAPI FHIR JPA server, with whether each factor is one-time or recurring. Use it to scope a quote, since most drivers are set by your data, your client applications and how long you run both systems in parallel.

DriverWhy it changes cost or effortOne-time or recurringWhat to ask for in a quote
Resource types and profiles in useEach resource type and profile adds mapping, validation and load testing. Custom profiles and extensions need to be loaded into the target server before data can be validated against them.One-timeA list of resource types, profiles and extensions, with counts per type from the HealthLake export
Data volume and ndjson file countLarger exports take longer to transform, load and reconcile. The number of files affects how the load is split and how completeness is checked.One-timeExport size, file count and the load method, including how throughput will be tested before cutover
Transform logicDifferences in resource shape, identifiers, references and vendor extensions require custom code. Each rule adds design, test and review time.One-time, with ongoing change if source data keeps changingA transform inventory with each rule, its owner and the test data used to verify it
Search parameter and custom operation parityHealthLake search behavior and any custom operations must be matched or replaced on HAPI FHIR. Gaps usually surface late in client testing.One-timeA list of search parameters and operations in use by clients, with a parity result for each
Client applications and authentication changesEach application that connects to HealthLake must be re-pointed and may need new credentials or token handling. The number of integrations sets the testing load.One-time, with recurring access reviewsNumber of client applications, their auth method today and the target identity provider design
Length of the parallel runRunning both systems keeps two sets of data, access paths and monitoring active. Longer parallel runs increase infrastructure and operations effort.Recurring while both systems runThe planned length of the parallel run, the sync method and the exit criteria for switching off HealthLake
Target infrastructure: Kubernetes or application serverDocker, Helm, Kubernetes or a WAR on an application server each carry different setup and operations work. The HAPI FHIR 8.2.0 line requires JDK 17, which is one input to the platform build.One-time build, recurring operationsThe chosen runtime, Java version, and who patches and upgrades the platform
Database, network and backupThe JPA server supports PostgreSQL and Microsoft SQL Server for production, but not MySQL. Storage sizing, network paths, backup and restore tests all add cost that recurs after cutover.One-time setup, recurring hosting and backupDatabase engine and version, storage estimate, backup and restore test plan, and network design

What usually goes wrong in a HealthLake to HAPI FHIR move and how to prevent it

Most failed HealthLake moves do not fail at export. They fail in the details that HealthLake handled for the team: search behavior, reference integrity, security defaults, audit trails, and the period when two systems hold data at once. Each risk below has a concrete check to run before cutover.

Profile and search parameter mismatches

HealthLake data store configuration, supported profiles and search parameters may not match what your HAPI FHIR server exposes by default. Client queries that worked against HealthLake can return empty or different result sets, and nothing fails loudly. Inventory every search call your applications make, then confirm each parameter, modifier and profile is supported on the HAPI FHIR server, and load any required implementation guide packages before testing.

JPA server docs

Dangling references after load

NDJSON files from a bulk export can arrive in an order that breaks references, and IDs can change if the loader assigns new ones. The result is Patient, Observation and Encounter resources that point to targets that do not exist on the new server. Preserve resource IDs during load, load referenced resources before referencing ones, and run a script that resolves every reference type in the loaded data and reports misses.

Assumed parity for managed security

HealthLake runs inside AWS with access controls, encryption and logging configured by the service and your IAM policies. HAPI FHIR does not provide a single security layer. It offers building blocks such as the AuthorizationInterceptor, authentication interceptors, CORS support and BALP audit logging, and your team must wire them to your identity provider. Write down each HealthLake control you relied on, map it to a specific HAPI FHIR component or infrastructure control, and test that each one denies what it should.

Security docs

Missing audit and consent controls

Access logging and consent enforcement that ran through HealthLake may have no equivalent on the new server until someone builds it. Without audit records for reads and searches, and without consent or search narrowing where your policy requires it, you cannot answer who accessed which patient record after cutover. Before loading production data, confirm which access events must be logged, where those logs are stored and who reviews them, and test that the audit trail captures a read from each client type.

Parallel run without a write owner

During cutover both systems may accept writes, so a Patient updated in HealthLake can diverge from the copy on HAPI FHIR. Without a named owner for each resource type and a rule for which system is authoritative, reconciliation becomes guesswork. Decide the write freeze point or the source of truth per resource type, route applications explicitly, and reconcile counts and recent changes against the frozen export at a fixed checkpoint.

Decommissioning HealthLake too early

Turning off a HealthLake data store removes the only complete copy of data that may still be needed for retention, audit or a dispute. Teams often decommission once the first read succeeds on the new server. Keep the export, the HealthLake data store and its logs until your retention and legal hold requirements are confirmed in writing, and record where each archived copy sits, who can restore it and how long it must be kept.

Questions buyers ask before moving from HealthLake to HAPI FHIR

What does a HealthLake to HAPI FHIR migration cost, and what drives the price?

The cost comes from labor and infrastructure, and the largest share is usually the people time needed to export, transform, load, verify and cut over. Expect one-time work for scoping, export and transformation scripts, loading, search and profile parity checks, and cutover, plus recurring costs for the cloud or data center resources that run the HAPI FHIR server, its database, backups and monitoring. Cost rises with data volume, the number of resource types and custom profiles, how many integrations depend on HealthLake, and how much parallel running is required. Ask any quote to list each phase, who performs it, which environments are included, and which recurring costs the client carries directly. DeployOpen does not publish a price list, and a quote follows from the written scope.

How long does the migration take, and what sets the duration?

Duration depends mainly on the size and shape of the data, the number of integrations to repoint, and how much clinical or compliance review is required before cutover. Export time depends on the HealthLake data store and the bulk export job, while transformation and loading depend on file volume and the throughput you can tune on the target. Validation, including count checks and comparison of key searches, often takes longer than loading. Ask for a timeline with dated milestones that depend on client sign-offs, and treat any date given before the data inventory is complete as provisional.

What does the migration need from our team?

The work needs named people from several roles, and availability of those people often determines the schedule more than technology does. You will need data owners who can confirm which resource types and history must move, a platform owner who controls the cloud accounts, networks, DNS and secrets, and clinical or compliance reviewers who sign off on data handling and cutover. Your team must also grant access to the HealthLake account so the export can run and the resulting S3 objects can be read. Confirm these roles, their time commitments and their decision rights in the scope before work begins.

Can our internal team run this migration without a partner?

Yes, if your team has engineers who can operate Java services, PostgreSQL or SQL Server, Kubernetes or a servlet container, and who understand FHIR search and profiles well enough to test parity. The harder parts are usually verifying completeness, reconciling search behavior between the two systems and designing the cutover and rollback. A partner can take on a defined part, such as the transformation pipeline or the parity testing, while your team keeps ownership of data decisions. Ask which tasks you would hand over, what your team must learn to operate the result, and who handles the first upgrade of HAPI FHIR after go-live.

Can HAPI FHIR replace every feature we use in HealthLake?

No. HAPI FHIR provides a JPA server that implements the FHIR REST API with versions DSTU2, DSTU3, R4, R4B and R5, plus terminology services, validation, MDM and partitioning, but it is not a managed service with the same built-in behavior. HAPI FHIR does not provide a single security layer. It supplies building blocks such as authentication interceptors, the AuthorizationInterceptor, consent and search narrowing interceptors, CORS support and BALP audit logging, which you must configure and test. Features tied to AWS, such as IAM policies, CloudWatch logging and HealthLake-managed encryption and scaling, need replacements you choose and operate. List every HealthLake feature you rely on and map each one to a HAPI FHIR capability, a self-built component or a retired function.

How do we run both systems during the parallel run and cutover?

Run HealthLake and HAPI FHIR side by side, keep HealthLake as the system of record until verification passes, and switch clients in controlled stages. Before cutover, compare resource counts by type, check representative searches and read results, and confirm that identifiers and references resolve. Writes need a clear rule during the parallel period, either freezing writes to HealthLake or replaying them into the new server, and that rule must be agreed with the data owners. Cutover should include a rollback path that points clients back to HealthLake until the agreed exit criteria are met.

Does the migration change our compliance position?

Moving to a self-hosted server changes who operates the controls, so your compliance team must review the new control owners before cutover. You become responsible for access control, audit logging, backups, encryption and patching that HealthLake previously handled under AWS, and HAPI FHIR gives you building blocks for them rather than finished controls. DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors and certification bodies issue any audit reports or attestations. Ask your compliance lead to confirm the control mapping, data residency and business associate arrangements before the data moves.

How DeployOpen works on this

DeployOpen plans and runs a HealthLake to HAPI FHIR migration as a written, fixed-scope engagement inside your own cloud accounts or data centers. The work follows the same arc from scope through build, handover and ongoing support, so your compliance, security and clinical teams can review each step.

How we scope

  • Inventory the HealthLake data store, resource types, profiles and search parameters that clients depend on today.
  • Confirm which HealthLake features your applications use, such as SMART authorization, notifications and bulk export, and map each to a replacement.
  • Agree the target HAPI FHIR version, JDK requirement, PostgreSQL or SQL Server database and hosting model in the written scope.

How we build

  • Set up the HAPI FHIR JPA server starter in your environment, with configuration, reverse proxy and health checks documented.
  • Build the transformation and load pipeline for the ndjson files exported to S3, with ID and reference handling tested on a sample.
  • Test search parity, authorization rules and count reconciliation between the HealthLake source and the HAPI FHIR target before cutover.

How we hand over

  • Deliver runbooks for the export, load, reconciliation and cutover steps, including the dual-running period and rollback path.
  • Document the security controls you own around HAPI FHIR, including authentication, the AuthorizationInterceptor, audit logging and network controls.
  • Walk your platform, security and compliance teams through the deployed system and the evidence they will need for their own reviews.

How we support

  • Ongoing support, HAPI FHIR upgrades and continuous security testing are available as retainers after handover.
  • Confirm with DeployOpen during scoping which upgrade, patching and on-call responsibilities continue under a retainer and which stay with your team.
  • Plan the HAPI FHIR upgrade path and schema migrations as part of the handover so later version changes are scheduled, tested and documented.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.