Hello everyone,
I’m working on migrating from a SQLite-backed Orthanc instance to a PostgreSQL-based setup using the official python-orthanc-tools (GitHub - orthanc-team/python-orthanc-tools), specifically the OrthancCloner class.
Source Orthanc:
- SQLite backend (default install)
- Running on
localhost:8042
- Uses storage folder
E:\Orthanc
Destination Orthanc:
- PostgreSQL backend enabled
- Running on
localhost:8052
- Uses the same StorageDirectory (E:\Orthanc)
- Configured with
EnableIndex=true
andEnableStorage=false
- Both Orthancs are installed via the Osimis Windows package (Orthanc v1.12.1, PostgreSQL plugin v5.1)
PostgreSQL Config:
“PostgreSQL”: {
“EnableIndex”: true,
“EnableStorage”: false,
“Host”: “localhost”,
“Port”: 5432,
“Database”: “”,
“Username”: “”,
“Password”: “”,
“Lock”: true,
“EnableSsl”: false,
“MaximumConnectionRetries”: 10,
“ConnectionRetryInterval”: 5,
“IndexConnectionsCount”: 50,
“TransactionMode”: “ReadCommitted”,
“EnableVerboseLogs”: false,
“HousekeepingInterval”: 1,
“AllowInconsistentChildCounts”: false
}
Python Migration Script:
from orthanc_tools import OrthancCloner
from orthanc_api_client import OrthancApiClient
source = OrthancApiClient(‘http://localhost:8042’, user=‘’, pwd=‘’)
destination = OrthancApiClient(‘http://localhost:8052’, user=‘’, pwd=‘’)
cloner = OrthancCloner(source=source, destination=destination, worker_threads_count=1)
cloner.execute(existing_changes_only=False)
Issue:
While the source Orthanc works fine, I see the following error in the destination Orthanc (PostgreSQL) CMD window when I start migrating:
I0611 08:08:39.272332 OrthancRestApi.cpp:163] (http) Receiving a DICOM file of 528298 bytes through HTTP
E0611 08:08:39.301976 PluginsManager.cpp:153] SQLite error code 5
E0611 08:08:39.310073 PluginsManager.cpp:153] SQLite: Cannot run a cached statement
This is confusing because the PostgreSQL index is enabled and storage is on disk — not in SQLite. Could it be due to both Orthanc instances accessing the same StorageDirectory
? Or is there something wrong with the cloner setup?
Any advice from others who have used OrthancCloner, or who have migrated index backends while preserving disk storage, would be greatly appreciated!
Thanks in advance!