Data migration using admin console medplum 3.3.0
# support
r
Hi, I have recently started the Data Migration task in Super admin console. After starting the job, I have received a notification saying "Running data migration" and after a while when I came back to the admin console tab, there was no acknowledgement regarding the data migration. In the Cloud Watch logs, I can see "Reindex completed" log for different resources. I am confused whether my data migration is completed or failed. When I visit "https://app-staging.neelyx.bio/admin/super/asyncjob", I can see the message "Failed to load migration info". Is there a way to check if my data migration is successful or failed. Thanks
f
hey @rk00600 , can you query your AsyncJob resources by doing something like
GET https://app-staging.neelyx.bio/fhir/R4/AsyncJob?type=data-migration
r
Hi @finnbergquist, The command you shared is not working. I am getting Error not found. I used the following command
Copy code
medplum post admin/super/setdataversion "{ \"dataVersion\": 1 }"
The output is
Copy code
{
  "resourceType": "OperationOutcome",
  "id": "ok",
  "issue": [
    {
      "severity": "information",
      "code": "informational",
      "details": {
        "text": "All OK"
      }
    }
  ],
  "extension": [
    {
      "url": "https://medplum.com/fhir/StructureDefinition/tracing",
      "extension": [
        {
          "url": "requestId",
          "valueId": "b5f9c06f-1229-4448-bccf-1275cd9841fc"
        },
        {
          "url": "traceId",
          "valueId": "1-68a5d382-25f3ee2f44d763e76c49bea5"
        }
      ]
    }
  ]
}
Thanks for your help. I am done with the data migration.
f
Ahh gotcha, that request would actually need to be
<your-server-url>/fhir/R4/AsyncJob?type=data-migration
not your app URL
r
Hi @finnbergquist I just upgraded my medplum prod server from 3.2.12 to 3.3, but I don't see the "Run Data Migrations" button in my admin console.
Copy code
September 18, 2025, 16:08
{"level":"INFO","timestamp":"2025-09-18T21:08:17.183Z","msg":"Data migration ready to run","dataVersion":1}
MedplumTaskDefinition
September 18, 2025, 16:08
A new version (v4.3.13) of Medplum is available. Your current version (v3.3.0) may be missing important updates and bug fixes.
MedplumTaskDefinition
September 18, 2025, 16:08
{"level":"INFO","timestamp":"2025-09-18T21:08:10.376Z","msg":"Starting Medplum Server...","configName":"aws:/medplum/prodv2/"}
Above are the logs from my ECS Task, The logs indicates "Data migration ready to run", but I couldn't see "Run data migrations" Button in the admin console.
Is there any other way to trigger the data migration?
When I run the "medplum post admin/super/setdataversion "{ \"dataVersion\": 1 }" in my cmd. I am getting the same message.
Is there a way to see the status of the data migration?
n
You may need to upgrade medplum app to the matching version of medplum server to see the button. You can see the current version of medplum app by inspecting the html within the
<head>
or running
document.querySelector('[name="medplum-version"]').content
in the console.
r
Thanks @nathan-watkins-unityai My medplum app version is same as the medpum server version. Is there any other way to run the data migration or is there a way to validate the status of the data migration?
c
Hi @rk00600 - the 3.3.0->4.0.0 upgrade was admittedly a rough one. We wrote up a longer form guie at the time: https://www.medplum.com/blog/v4-upgrade See the section on "Skipping the Migration (For Deployments Started on 2.2.0 or Later)", which applies to most people. That's the fastest way to get through it.
r
Thanks a lot @cody I skipped the data migrations by setting "dataVersion" to 1 and upgraded the server to 4.0 version. Everything went smooth during the process. After that, I have upgraded to 4.1.0 and all the post-deploy migrations are completed. But when I deployed 4.1.12, I am facing issues with the post-deploy migrations. One of the AsyncJob is in accepted status forever, the job doesn't have Parameters in the output. This job is preventing the following jobs to execute.
c
how long is "forever"? how much data is in your database?
I'd need to go back to our notes. There were a couple migrations in that sequence that re-indexed the entire database to add new precomputed search columns. That process can takes ~hours for large data sets and ~days for extra large data sets.
r
Thanks a lot @cody for your quick response. There isn't a lot of data. For reference, post-deploy migrations after 4.1.0 took around 35 minutes. But, new AsyncJob is still in accepted status since 6 hours. Also, AsyncJob resource doesn't have any Parameters in the output and I haven't seen any logs in my AWS ECS Task.
c
Was there any notable output in the server logs (i.e., in CloudWatch Logs)?
r
There is no notable output in the server logs, all the logs are operations related(creating resources, email and authentication). The AsyncJob is still in accepted state. Does that mean the job has failed? Is there a way to check the current status of the job?
Hi @cody The AsyncJob is still in accepted stage, does this mean the job is failed?
i
@rk00600 , I wanted to follow up with this one here. Did you get this resolved?
r
Thanks @Ian Plunkett , the issue is now resolved. The Asycjob stayed in accepted stage for almost a week and when we tried again, It executed.
n
Just curious- what prompted it to "try again"? Redeploying?
r
My teammate clicked the Run data migration button and the Async job is completed. We really don't have an idea why it happened
117 Views