Migrating from HAPI FHIR to Medplum: what the move involves
A team running a HAPI FHIR JPA server can move its resources to Medplum through documented export and load paths, but the server itself is not a file copy. The resources move; the surrounding configuration is rebuilt. That split should shape the plan from the start: the data pipeline is one workstream, and the profiles, Subscriptions, Bots, identity setup and access rules are separate workstreams that need their own design and sign-off on the Medplum side.
On the data side, the source is a HAPI FHIR JPA server backed by PostgreSQL or Microsoft SQL Server, since the starter does not support MySQL. Your first decision is the export method: Bulk FHIR export where the server exposes it and the resource volume justifies it, or paged search where you need finer control over which resources and versions are pulled. Whichever you choose, confirm which FHIR version your HAPI instance serves (DSTU2, DSTU3, R4, R4B or R5) because Medplum's API is FHIR R4, and resources in other versions need conversion before load. Keep the original id and identifier values, so references and the source-to-target mapping remain traceable.
Effort is driven less by Medplum than by how much of your HAPI setup carries business logic. Custom resource profiles, validation rules, terminology services, MDM matches, partition layouts and the AuthorizationInterceptor rules each need a Medplum equivalent, typically Project-level access policies, Bots and Subscriptions, and each equivalent has to be tested against your real use cases. A server with few custom profiles and simple access rules is a much smaller job than one with years of interceptors and partitioned tenants. Medplum also expects upgrades to be planned as a sequence on self-hosted deployments, so confirm the target release with the Medplum releases page and plan the install path before you build.
Before committing to a timeline, ask your team or a partner to inventory three things: every interceptor and custom operation in the HAPI server, every Subscription and its downstream consumer, and every client application and its authentication method. Those lists determine the rebuild scope and the acceptance criteria for count and reference reconciliation. Any duration quote should follow from that inventory, not from a generic estimate.
Which HAPI FHIR capabilities map to Medplum and which need rebuilding
This table compares each HAPI FHIR capability your source server uses with its Medplum equivalent, or marks it as work to rebuild. Read the rows against the FHIR version your HAPI FHIR server runs, since R4B, R5 and DSTU3 content changes the mapping. The main takeaway is that stored resources and standard R4 search usually carry over, while server-side authorization, Subscriptions and partitioning need design work on the Medplum side.
| Capability | HAPI FHIR JPA server | Medplum equivalent or rebuild work |
|---|---|---|
| Resource storage and R4 search | JPA-backed FHIR REST server with R4, R4B, R5 and DSTU3 support, using a database through JPA | Medplum stores R4 resources in PostgreSQL and exposes an R4 REST and search API. Confirm each search parameter your clients use is supported before cutover. |
| Identifiers and references | Identifiers and logical or literal references stored as submitted | Keep source identifiers in identifier arrays and document the mapping. Re-create references after loading so Medplum IDs resolve, and reconcile them in the validation step. |
| Profiles and validation | Profile validation and terminology checks through the validation module, with custom StructureDefinitions loaded into the server | Medplum validates against base R4 and the profiles you load. Re-create each custom profile as a StructureDefinition and test sample resources against it. Confirm profile support in your Medplum version. |
| Terminology services | Built-in terminology services for code systems, value sets and lookups | Confirm which code systems and value sets your data needs and whether Medplum serves them directly or through an external terminology service. Loading large code systems is a planning item. |
| Subscriptions | FHIR Subscriptions configured on the HAPI server and delivered to endpoints | Medplum Subscriptions and Bots must be re-created and tested. Subscriptions that fire on load will trigger side effects, so disable or gate them during bulk import. |
| Authorization and access rules | AuthorizationInterceptor and related interceptors that you build and wire in, since HAPI provides building blocks rather than one security layer | Medplum access policies, projects and membership rules replace interceptor logic. Map each HAPI rule to a policy and test it with real client identities. |
| Audit logging | BALP audit logging through interceptors you configure | Medplum records AuditEvent resources for activity on the platform. Confirm the events your compliance team expects and test that they are retained. |
| Partitioning and multitenancy | JPA partitions for multitenancy, separate data sources or regional grouping | Medplum uses projects and access policies for tenant separation. Map each partition to a project design, and plan how resources that cross partitions will be moved or referenced. |
| Specification version and R5 content | R4, R4B, R5 or DSTU3 endpoints depending on configuration | Medplum's documented APIs are FHIR R4. R4B or R5 content needs a decision: convert to R4, keep it as an extension or attachment, or leave it out of scope. Confirm this with the data owner before mapping starts. |
Exporting from HAPI FHIR: Bulk FHIR export or search
Bulk FHIR export is the path for moving a full dataset or a large share of it. Instead of paging through search results one request at a time, the source server produces newline-delimited files per resource type, which the destination can load in bulk. The export is asynchronous: a client requests a kick-off, polls a status endpoint, and downloads the output files once the job completes. Because the server generates the files, it is the path most likely to carry resource content intact, including the resource ID, meta and versionId fields that the source stores with each resource. Reference strings in the files still point at source IDs, so the loader must keep those IDs or rewrite them through a documented map.
- Operation support: Confirm which bulk export operations your HAPI FHIR version exposes, including whether system-level, patient-level and group-level exports are enabled, and whether the server is configured to allow them for your client.
- Resource coverage: Check the requested
_typelist against the resource types you hold, including custom profiles and less common resources, since omitted types will not appear in the output. - Consistency of the snapshot: Confirm how the server handles writes that happen while an export runs, and plan a freeze or a delta pass before cutover.
- Output handling: Plan storage, checksums and retention for the output files, which can be large, and confirm whether download URLs expire.
- Referential gaps: Patient-level or group-level exports may omit resources that are referenced but not linked to the selected patients, so confirm which references resolve inside the export.
Before relying on the export, confirm the per-type line counts against your source counts and record the job ID and time window in your migration manifest.
Paged FHIR search uses standard RESTful queries such as GET [base]/Patient?_count=... and follows next links in each Bundle. It works on any HAPI FHIR version that serves the search API, requires no special export configuration, and is the natural fit for a single resource type, a filtered subset, or an incremental pull that picks up resources changed since a given point using _lastUpdated. Search returns the resource as the server currently reports it, so IDs, meta and references are visible in the response, but the result set is only as stable as the paging and sort order the server applies.
- Unstable paging: Results can shift between pages when resources are created or updated during the run, so records may be duplicated or skipped. Pair the query with a stable sort and a fixed
_lastUpdatedupper bound. - Count limits: Confirm the maximum page size and any server-side caps on total results, because a query that quietly truncates will look successful.
- Include and revinclude: Use
_includeand_revincludedeliberately to pull referenced resources, and record which references were not resolved. - Deleted and history data: Search does not return deleted resources or prior versions by default, so decide whether history is in scope and export it separately if it is.
- Throughput: Large pulls through search are slower and more load-intensive on the source than a bulk export, so schedule them against the source's capacity.
Record the query, the page count and the total returned for each resource type, then reconcile those totals against independent counts from the source database.
Most migrations combine both paths. A bulk export takes the bulk of the data, and search runs as a delta pass for resources changed after the export snapshot, or for a targeted subset such as a single resource type that failed validation. The decision depends on dataset size, how much write traffic continues during the move, whether the source offers the operations you need, and how much you trust the source's counts. Neither path preserves everything automatically: both need the mapping and identifier rules to be set before the export starts, so that references stay meaningful in Medplum.
- Dataset size and window: Larger datasets favor bulk export, while small or filtered datasets may not justify the setup.
- Write traffic: If the source keeps accepting writes, plan a delta pass keyed on
_lastUpdatedwith an overlap window. - Identifier preservation: Decide whether source IDs will be kept as Medplum IDs, stored as identifiers, or both, before any export runs.
- Authorization: Confirm the credentials you use can read every resource type you intend to move, since partitioned or consent-filtered data may hide resources from a restricted client.
- Evidence: Keep each job's parameters, time window and output counts in the manifest so the reconciliation later has a fixed reference point.
Confirm the export path and the delta strategy with the team that owns the HAPI FHIR server before scheduling the first run.
Sequence for a parallel run and cutover from HAPI FHIR
This sequence moves a HAPI FHIR dataset into Medplum without a single big-bang switch, keeping HAPI as the system of record until the Medplum copy has been proven complete and consistent. It ends with a cutover of reads and writes and a decommissioning plan that keeps the HAPI server available for rollback.
Inventory resource types and profiles
Your data team and FHIR architect list every resource type stored on the HAPI server, with counts per type, the profiles and extensions in use, and any custom search parameters, terminology bindings or partitions that carry meaning. Confirm which HAPI version and JDK your source runs, since the HAPI FHIR documentation ties requirements to specific releases. The step is done when the inventory is signed off and each resource type is marked as migrate, transform, or retire.
Export a pilot set into a non-production project
Export a representative subset from HAPI using Bulk FHIR where your HAPI configuration supports it, or paged FHIR search where it does not, and load it into a separate non-production Medplum project. Keep the original resource IDs and identifiers in the load so the pilot can be compared against source. Engineers record every failed resource and the reason. The step is done when the pilot loads without unresolved errors and the failure log is reviewed by the data owner.
Reconcile identifiers and references
Compare identifiers such as MRN, system and value pairs, and logical IDs between HAPI and the pilot Medplum project, and confirm that every Reference resolves to a resource in the target. Check references that point to resources in other partitions or that use relative URLs, because these often break during export. Record each mismatch with a decision on whether to rewrite, retain or drop it. The step is done when the reconciliation report shows zero unresolved references and each identifier maps to exactly one Medplum resource.
Re-create access rules, Subscriptions and clients
Rebuild the authorization model that HAPI enforced through its interceptors in Medplum access policies, projects and client applications, and recreate any Subscriptions or Bots that downstream systems depend on. Test each role against the pilot data with real test accounts, and confirm that SMART scopes and client credentials behave as the source did. The step is done when every role has a documented test that passes and no downstream consumer is still pointed at HAPI by accident.
Run the parallel load with HAPI as write authority
Keep HAPI as the only system accepting writes while a scheduled delta load copies new and changed resources into Medplum. Compare resource counts by type and by last-updated window after each run, and log every divergence. Side effects such as Subscription notifications should be suppressed or directed to a test endpoint during this phase. The step is done when several consecutive delta loads reconcile cleanly against HAPI and the owners accept the counts in writing.
Validate counts and cut over reads and writes
Before the switch, run a final full count reconciliation by resource type, a reference check, and a sample review of whole records chosen with clinical and business owners. Freeze writes on HAPI, run the last delta, then point readers and then writers at Medplum, with the rollback trigger and the person authorized to invoke it written down in advance. The step is done when post-cutover counts match the frozen source and the first production transactions succeed end to end.
Hold HAPI for a rollback window then decommission
Keep the HAPI server, its database and backups read-only for a rollback window that your change board sets, so the team can return to HAPI if a defect appears. Confirm that no clients still call the old endpoint by reviewing access logs. When the window closes without a rollback, export a final backup, archive it under your retention policy, and retire the HAPI server and its database. The step is done when the decommissioning record shows the backup location, the access log review, and the approval to retire.
How resources flow from HAPI FHIR into Medplum
The flow starts at the HAPI FHIR JPA server in the source network, where resources are exported through Bulk FHIR or paged search. An extract and transform stage in a separate environment keeps identifiers and references intact, then loads the result into a Medplum project through batch or transaction bundles on the self-hosted server. The last step is reconciliation, which compares resource counts and references back to the source. Check each boundary crossing, since data leaves the source network and enters the transform environment before it reaches Medplum.
Export, transform, load and reconcile across three trust boundaries.
What must be re-created in Medplum, not copied
Most HAPI FHIR behavior lives in configuration, interceptors and database partitions that do not move with a data export. Each component below needs an explicit Medplum equivalent, and the team should confirm every mapping against its own HAPI configuration before cutover.
Custom StructureDefinitions and profiles
In HAPI, custom profiles are often loaded into the server's validation support or uploaded as StructureDefinition resources, and the server enforces them on write. Medplum validates resources against the profiles it has loaded, so the team must re-upload each custom StructureDefinition, check that dependent ValueSets and CodeSystems exist, and confirm which profiles Medplum enforces on create and update. Resources that passed HAPI validation can still fail in Medplum, so run the migrated data through validation before counting it as loaded.
Medplum versionsSubscriptions and their criteria
A HAPI JPA server exposes Subscription resources and delivers notifications through its own subscription channels. In Medplum, Subscriptions are re-created as resources with criteria, channels and endpoints that point at Bots or external receivers. Copy the criteria strings exactly, then test each one against sample resources, because a Subscription that is created during a bulk load can fire for historical data. Pause or filter subscriptions until the load is reconciled.
Bots that replace HAPI interceptors
HAPI interceptors run inside the server process and can change requests, reject writes or add data. Medplum has no direct equivalent to a Java interceptor. The matching logic usually moves into Medplum Bots, triggered by Subscriptions or invoked by clients, and it must be rewritten and tested in TypeScript. Inventory every interceptor in the HAPI deployment, classify it as validation, enrichment, authorization or audit, and confirm which behaviors the Bot must reproduce before cutover.
Access policies in place of authorization rules
HAPI deployments usually enforce access with the AuthorizationInterceptor, consent interceptors, search narrowing and, where used, partition assignments. Medplum expresses access through AccessPolicy resources attached to projects and users, and multi-tenant separation is handled at the project level rather than by HAPI partitions. Map each rule to an access policy, then test with representative users for both allowed and denied reads, searches and writes, since a missing policy usually fails open for one role and closed for another.
Medplum authenticationSMART client registrations and identity provider setup
HAPI leaves identity to the surrounding stack, so existing SMART on FHIR clients usually authenticate against an external provider or a servlet filter. Medplum Auth handles OAuth, OpenID Connect and SMART on FHIR itself, and it can use Medplum as the identity provider, an external provider or a domain-level corporate provider. Register each client again with its redirect URIs and scopes, configure the identity provider and multi-factor settings, and confirm which client credentials or signed token flows machine clients need.
Medplum authentication docsAudit logging and retention
HAPI offers BALP audit logging through its own building blocks, and many organizations also feed those logs into a SIEM. Medplum records activity through its own audit resources, so the team must decide which events must be preserved, where the HAPI audit history is archived, and how the two sources will be queried during the transition period. Confirm the mapping with your compliance lead, because audit history from the old server is not automatically visible in Medplum.
Preserving identifiers and references when moving HAPI FHIR data
Keep every source logical ID, business identifier and reference in a mapping register before the first load, because a migrated record is only useful if the rest of the chart can still find it. A HAPI FHIR server assigns each resource a logical ID, and your organization also uses business identifiers such as MRNs, encounter numbers, and national or payer IDs. Decide, per resource type, whether the source logical ID is kept as-is, stored as an identifier with a dedicated system URI, or replaced by a new Medplum ID with the old value recorded in the register. Confirm with your clinical and data owners which identifier is the authority for patients and encounters, since that choice drives matching and duplicate handling later.
Use conditional create or conditional update keyed on those identifiers so that reruns of a loader update existing resources instead of creating duplicates. This makes a failed batch safe to retry and makes a full reload a repeatable test. Check in a Medplum test project that your loader's search criteria return exactly one match per resource before you rely on them, and confirm the exact conditional syntax your loader uses against the current Medplum documentation rather than assuming it from HAPI FHIR behavior.
Load resources in dependency order so that every reference resolves when the dependent resource is written. An Encounter that points to a Patient, or an Observation that points to a Practitioner, fails or dangles if its target is not yet present, so the register must map each source reference (for example, Patient/123 in HAPI FHIR) to its target in Medplum before the referencing resource is sent. Treat unresolved references as exceptions to be listed and resolved, not silently dropped, and record them so the reconciliation step later can prove that every reference in the source was either resolved or deliberately excluded.
How much effort and time does a HAPI FHIR to Medplum move take?
What drives the effort and cost of a HAPI FHIR to Medplum migration?
The size and shape of the data, and how much of it must be mapped, decide most of the effort. Resource counts matter less than how many resource types, custom profiles, extensions, terminology bindings and reference chains the source server holds. Other drivers include how many Subscriptions, custom operations and access rules must be re-created, how clean the source identifiers are, and how many downstream systems read from HAPI today. Each of these adds mapping, pipeline and validation work. Ask any partner to break the quote into discovery, mapping, pipeline build, validation runs, cutover support and handover, so you can see which driver is behind each line.
How long does a HAPI FHIR to Medplum move usually take?
Duration depends on profile complexity, data volume and how many systems must be cut over together, so treat any single number as a planning input rather than a promise. Plan for distinct phases: discovery and inventory, mapping and pipeline build, repeated trial loads with reconciliation, and a rehearsed cutover. The trial loads often take the longest, because each run exposes mapping gaps that need another fix. Ask for a timeline built from measured load throughput on a copy of your data, not from resource counts alone.
What does the client's team need to provide during the migration?
The work needs time from people who know the data and the business rules. Your team should supply a HAPI FHIR server with a working export path, a list of the profiles, extensions and search parameters in use, and the owners of each downstream consumer. Clinical or data owners must confirm how conflicting records are resolved and which fields are authoritative. Your security team should review the access rules and audit requirements that move to Medplum. Agree on these named contacts and decision points before the statement of work is signed.
Can our own engineers migrate from HAPI FHIR to Medplum without a partner?
A capable FHIR engineering team can do the work, provided it has time, familiarity with FHIR R4 and the Medplum APIs, and someone accountable for validation. The hardest parts are usually not the exports but the mapping decisions, reference preservation and reconciliation evidence. Teams that do this alone often underestimate the number of trial loads needed. A partner adds most value when the timeline is tight, when several systems depend on HAPI at once, or when independent evidence of completeness is required for an assessment. Compare the internal estimate against the same scope list you would give a partner.
Does choosing Medplum Cloud or self-hosting change the migration work?
The data work is largely the same, but the operating model is not. On Medplum Cloud, the vendor runs the platform and its upgrades, while your team owns the data mapping, load and validation. Self-hosting adds infrastructure, database, backup, monitoring and upgrade work to your scope. The self-hosted upgrading guide states that upgrades must pass through each minor version in sequence and that post-deploy data migrations can run for hours or days on large datasets, so plan that time before cutover. Confirm the hosting choice early, because it changes the infrastructure, on-call and compliance work in the quote.
How do we validate that record counts match before cutover?
Validation should compare counts by resource type, and by resource type within each partition or tenant, between the HAPI source and the Medplum target after each trial load. Use the same export method for both sides where possible, and record the reasons for any difference, such as rejected or merged records. Check that references resolve on the Medplum side and that the identifiers you preserved still match the source. Counts alone do not prove correctness, so add sampled whole-record comparisons and keep the reconciliation output as evidence. Require these checks, and their acceptance thresholds, in the written scope.
What should a quote for this migration include?
A useful quote lists scope in writing: the source HAPI version and deployment, the resource types and profiles in scope, the export method, and the Medplum deployment target. It should itemize discovery, mapping, pipeline build, trial loads, validation, cutover support, re-creation of Subscriptions and access rules, and handover documentation. Separate one-time work from recurring items such as hosting, upgrades or support. Ask which assumptions the price depends on, what changes are excluded, and how additional profiles or data defects are priced. DeployOpen plans most engagements as fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
What drives the cost and duration of the move
This table lists the factors that raise or lower the effort of moving from a HAPI FHIR server to Medplum, with the direction of each effect and what to confirm in a written scope. Read it before asking for a quote, because the drivers you can measure in your own server will set most of the estimate.
| Driver | Why it changes effort | What to confirm in the written scope |
|---|---|---|
| Data volume and resource mix | Larger stores and more history mean longer exports, longer loads and more reconciliation. Heavy use of Binary or DocumentReference content adds transfer time. | Resource counts by type, version history kept or dropped, and whether attachments move with the data |
| Custom profiles and extensions | Each StructureDefinition, slice and extension must be re-created, mapped or retired, which increases design and test work. | Inventory of custom profiles and extensions, and which ones downstream systems depend on |
| Subscriptions and interceptors | Server-side HAPI interceptors and subscription channels must be rebuilt as Medplum Subscriptions or Bots, and their side effects tested. | List of interceptors, subscription criteria and channel endpoints, with the expected behavior of each |
| Access rules and authorization | Mapping HAPI AuthorizationInterceptor rules, consent and search narrowing to Medplum access policies, projects and roles grows with rule count and exceptions. | Number of roles, compartments and rule exceptions, and who signs off on the access model |
| Identity provider integrations | Each connected identity provider, client registration and SMART or client credentials flow needs its own configuration and testing. | Identity providers in use today, token types, and whether MFA or domain-level sign-in is required |
| Reference depth and identifiers | Deep reference chains and inconsistent identifiers slow load ordering and patient matching, and create more exceptions to resolve. | Reference graph depth, identifier systems in use, and the matching rules agreed with the data owner |
| HAPI version and source database | The HAPI FHIR release, its JDK level and whether the source runs PostgreSQL or Microsoft SQL Server affect export tooling and how the data is read out. | Exact HAPI FHIR version, database engine and version, and access for the export account |
| Downstream consumers | Each system reading from the HAPI server needs a repointing, contract check and cutover window, which often costs more than the data move itself. | Count of consuming applications, their owners, and whether each one needs dual running |
| Medplum deployment target | Self-hosting on AWS, Kubernetes, Azure, Google Cloud or Ubuntu changes infrastructure, database and upgrade work. A hosted plan shifts some of that work to Medplum. | Chosen deployment method, who operates PostgreSQL and Redis, and who owns upgrades and monitoring |
What usually goes wrong in a HAPI FHIR to Medplum move
Most failed HAPI FHIR to Medplum moves fail in predictable places: the load itself, the references between resources, and the behavior that lives outside the data. Each card below names one risk, why it matters for this specific move, and the check that prevents it.
Dropped or duplicated resources
Bulk export and paged search can both miss or repeat records when the source changes during extraction, when a page boundary shifts, or when a loader retries without idempotency. A count that matches in total can still hide one missing type and one duplicate type. Compare counts per resource type and per partition against the source snapshot, and make every write a conditional update keyed on the original resource identifier so reruns do not create second copies.
Broken references between resources
HAPI FHIR stores references as relative or absolute IDs that may point to resources in another partition or to IDs that Medplum assigns differently on load. If the target has not been loaded yet, the referring resource fails or points at nothing. Keep the source ID in an identifier on every resource, load in dependency order, and run a reference reconciliation that resolves every subject, encounter and patient reference after load.
Profile validation failures on load
HAPI FHIR JPA can be configured to accept resources that do not conform to the profiles you later require in Medplum, and the reverse also happens when a custom StructureDefinition in the source is not re-created on the target. Export the StructureDefinitions and ValueSets your data depends on, load them before instance data, and quarantine each rejected resource with its validation message rather than retrying it blindly.
Silent loss of Subscription side effects
A Subscription on HAPI FHIR may notify a downstream system on every write. During dual write or backfill, those writes can reach Medplum, which may trigger Bots or Subscriptions that fire again against systems already updated, or they may fire on nothing at all if the Subscription was never re-created. Inventory every active Subscription, decide per subscription whether it runs during backfill, and test each one in a non-production project before cutover.
Access rules looser or tighter than the source
HAPI FHIR does not supply one security layer. Its access control comes from building blocks such as the AuthorizationInterceptor and search narrowing interceptors that your team has configured. Medplum expresses access through projects, access policies and related controls, so a direct translation can expose records the source hid or lock out clinicians who depended on them. Write the source rules as a test matrix of users, roles and resource types, then verify each role's visible counts on both systems.
HAPI FHIR security docsUpgrade surprises on self-hosted Medplum
A self-hosted Medplum server must move through each minor version in sequence, since skipping versions causes startup failures, and post-deploy data migrations can run for hours or days on large datasets. A migration that is planned against the newest release may need a different path once your team pins a version. Choose the target version before the rehearsal, record the upgrade path your team will follow, and time the data migration in the dress rehearsal rather than during cutover.
Medplum upgrade guideValidating counts and references before cutover
Set your acceptance criteria in writing before the first load runs, because a count comparison is only meaningful against a target agreed in advance. For each resource type in scope, record the expected count in the HAPI FHIR source, the number you expect in Medplum after accounting for any resources you deliberately exclude (for example, resources created by test runs or by the HAPI FHIR server itself), and the threshold for any difference. Keep a manifest of every export: the export method used (Bulk FHIR $export or paged search), the time it ran, the resource types and counts it produced, and the HAPI FHIR version it came from. The current HAPI FHIR release is v8.8.2, so record the version you actually exported from, since the manifest is what lets you explain a later discrepancy.
Compare counts per resource type between the source and the Medplum project, and then check that every reference resolves. Counts alone can hide a broken chain: a set of Observations can match in number while pointing at Patient IDs that never loaded. For each reference field (subject, encounter, performer, basedOn and similar), confirm that the target exists in Medplum and that its identifier still matches the value you preserved from the source. Keep the original HAPI FHIR resource IDs or a stable identifier with a known system so you can trace each record back. Where a reference cannot be resolved, log it as an exception with the resource type, the field, the source ID and the reason, and decide whether the load order or the mapping needs to change before you rerun.
Sample whole records and compare them with the source, because matching counts and resolving references still do not prove the content is right. Pick a sample that covers each resource type and each mapping rule, including records with extensions, profile tags, multiple identifiers and narrative text, and read the full record in both systems. Check the meta.profile values and any security or access-related tags, since profiles and access rules are often lost in transit. Record every exception in a single register with an owner and a disposition (fixed, accepted with sign-off, or deferred), and do not cut over with unexplained exceptions. Ask your clinical and compliance reviewers which exceptions need their approval, and confirm with Medplum's Medplum versions and release policy which Medplum version your target runs so your test results match the release you will operate.

