This post is an update on what I ended up doing. I hope it helps someone.
Instead of upgrading Orthanc and Postgres in my current VM and deal with potential upgrading issues, I decided it would be best to just create a new VM and try to reimport the DICOM images into a fresh database using the newest versions of Orthanc & Postgres. My line of thinking of was, this might be much cleaner, easier and faster to do it this way instead of trying to upgrade Orthanc & Postgres in the current production version.
Here is what I did.
After creating the new VM, I first created an Orthanc directory that would contain the configuration files (docker compose file, orthanc config, etc.) for Orthanc. The folder hierarchy looks like this:
/opt/
–– orthanc
|-- ImportDicomFiles.py
|-- compose.yml
|-- configuration.json
|-- ohif.js
|-- orthanc-index
|-- orthanc-storage
I then copied the directory that contains the DICOM images from the old VM to the orthanc-storage folder on the new VM.
I then created the compose.yml file for Orthanc. Here is the one I used. Since I was going to use the orthancteam docker image, I based my configuration off the example found here: orthanc-setup-samples/docker/postgresql at master · orthanc-server/orthanc-setup-samples · GitHub
Please note, it is recommended to shut off or remove the Verbose options once you have everything working. I currently have them enabled because I am still testing other configuration options.
services:
orthanc:
image: orthancteam/orthanc
depends_on: [orthanc-index]
restart: unless-stopped
ports: ["4242:4242", "8042:8042"]
volumes: ["./orthanc-storage:/var/lib/orthanc/db", "./ImportDicomFiles.py:/etc/orthanc/ImportDicomFiles.py:ro", "./ohif.js:/etc/orthanc/ohif.js:ro"]
environment:
VERBOSE_STARTUP: "true"
VERBOSE_ENABLED: "true"
PYTHON_PLUGIN_ENABLED: "true"
OHIF_PLUGIN_ENABLED: "true"
OSIMIS_WEB_VIEWER1_PLUGIN_ENABLED: "true"
STONE_WEB_VIEWER_PLUGIN_ENABLED: "true"
DICOM_WEB_PLUGIN_ENABLED: "true"
POSTGRESQL_PLUGIN_ENABLED: "true"
GDCM_PLUGIN_ENABLED: "true"
secrets:
- configuration.json
orthanc-index:
image: postgres:15
restart: unless-stopped
ports: ["5432:5432"]
volumes: ["./orthanc-index:/var/lib/postgresql/data"]
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
secrets:
configuration.json:
file: configuration.json
volumes:
orthanc-storage:
orthanc-index:
You will notice that I had to create the ImportDicomFiles.py. I did this because I found no other way to get this script inside the container. There might be a better, easier way but I did not find it. All I did to create this file was go to orthanc: 9551353f3e03 OrthancServer/Resources/Samples/ImportDicomFiles/ImportDicomFiles.py and save it locally to my VM. I did not modify this file in any way.
Next, I modified the Orthanc configuration file. Here is what my orthanc configuration file looks like. Use your own registered user information. I changed all the sensitive information below from what I am actually using 
{
"Name": "OrthancTEST1",
"DicomAet": "TESTS1",
"RemoteAccessAllowed": true,
"AuthenticationEnabled": true,
"PostgreSQL": {
"EnableIndex": true,
"EnableStorage": false,
"Port": 5432,
"Host": "orthanc-index",
"Database": "orthanc",
"Username": "orthanc",
"Password": "orthanc",
"EnableSsl": false,
"Lock": false,
"EnableVerboseLogs": true
},
"RegisteredUsers": {
"user1": "user1",
"user2": "user2"
},
"OHIF" : {
"DataSource" : "dicom-web",
"UserConfiguration" : "/etc/orthanc/ohif.js"
}
}
Finally, with everything in place, it was time to start Orthanc and do the reimport!
So, I went to the orthanc directory and ran docker compose up so I could see the output. In a separate terminal, I went to the orthanc directory and ran docker exec -it orthanc-orthanc-1 /bin/bash to get into the orthanc container. Once inside, I went to the /etc/orthanc folder.
From there, I ran: pip3 install httplib2 --break-system-packages I had to install the httplib2 package because ImportDicomFiles.py errored out the first time I ran it because that package was missing.
After httplib2 was installed, I finally ran: python3 ImportDicomFiles.py 192.168.0.10 8042 /var/lib/orthanc/db/ user1 user1 and the import started! Success!
The IP address in the ImportDicomFiles.py command I last ran is the IP address of the VM itself. I also had to add the username and password of the user I created in the orthanc configuration. If you are not going to have authentication for Orthanc and you omit the RegisteredUser stuff in the Orthanc configuration, then you would run the ImportDicomFiles.py command like this: python3 ImportDicomFiles.py 192.168.0.10 8042 /var/lib/orthanc/db/
My DICOM images are imported and everything is running good so far. I am still trying to tweak some settings regarding OHIF, but that’s a different problem for a different post lol
I really hope this helps someone who finds themselves in the same boat I was. There is probably a much better and easier way, but I couldn’t find it.