sync images from one orthanc server to another orthanc

is there any way to automatically sync images from one orthanc server to another orthanc?

This is explained in the Orthanc Book (“generic replication”):

Thank you very much Sébastien !

in windows whith orthanc, is just run the command “$ python 8042 OrthancStorage” ?


I must use first correct?

Hi Mauricio,

To run the script referred to in this thread, you will need python installed on your machine

The Python plugin you refer to is different and is used to extend your Orthanc server with python scripts.



Thanks for the answer James, i installed python on windows, but i got this error when executing the command, even downloading the replicate script.


C:\Program Files\Orthanc Server>python http://orthanc:“mypasswordForOrthancUser”@localhost:8042/ “destination ip without port”
Traceback (most recent call last):
File “”, line 23, in
import httplib2
ModuleNotFoundError: No module named ‘httplib2’

i installed httplib2 on windows whitn the command: python -m pip install httplib2

But now i got a new error:

C:\Program Files\Orthanc Server>python http://“myuser”:“mypassword”@localhost:8042/ “destination ip without port”
Traceback (most recent call last):
File “”, line 106, in
for study in DoGetJson(‘%s/studies’ % SOURCE):
File “”, line 100, in DoGetJson
return _DecodeJson(DoGetString(url))
File “”, line 66, in DoGetString
headers = CreateHeaders(parsedUrl)
File “”, line 54, in CreateHeaders
headers[‘authorization’] = 'Basic ’ + base64.b64encode(username + ‘:’ + password)
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\”, line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not ‘str’

C:\Program Files\Orthanc Server>

I got the same error using the port of orthanc on destiny server

I installed python 2.7 and configured the environment variables of windows, in addition to installing httplib2 again, now I received a new error that I am checking if it is a network thing.
Just a question, if it works, will it be automatic or do I have to leave a routine running this command?


Sending study f6c606ae-4ecacfdd-904cfc3d-da9c47b9-40801e21…
Traceback (most recent call last):
File “”, line 110, in
DoPostDicom(‘%s/instances’ % TARGET, dicom)
File “”, line 89, in DoPostDicom
raise Exception('Unable to contact Orthanc at: ’ + url)
Exception: Unable to contact Orthanc at: http://destiny ip:8042/instances

what do I need to release on the destination server to work?

I already disabled the firewall, but the error continues, do I have to do something on the server?

“Exception: Unable to contact Orthanc at: http://destiny ip:8042/instances”

Thank you very much James Manners, just missing the password on the destination server, I’ll try to find out why the slow delivery, but it worked.

What is the best way to obtain patient data before finishing synchronizing the dicom from one orthanc to the other? I tried to put the client orthanc to use the same database as the server orthanc, but it was slow as it is transferring the file where the internet is not good.

Sorry, I don’t understand your question.

Hello Sébastien,
I need to pass patient data from an orthanc postgres database to another orthanc database before the image loads.

As explained in the Orthanc Book, you can’t connect two Orthanc server to the same database (even if PostgreSQL is used):

Are you looking for the “generic replication” process?

I created a FOREIGN DATA WRAPPER on postgres to solve the problem of my worklist on the server.