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”):
https://book.orthanc-server.com/users/replication.html#generic-replication

Thank you very much Sébastien !

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

Yes.

I must use https://book.orthanc-server.com/plugins/python.html first correct?

Hi Mauricio,

To run the script referred to in this thread, you will need python installed on your machine https://www.python.org.

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

HTH

James

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

Error:

C:\Program Files\Orthanc Server>python Replicate.py http://orthanc:“mypasswordForOrthancUser”@localhost:8042/ “destination ip without port”
Traceback (most recent call last):
File “Replicate.py”, 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 Replicate.py http://“myuser”:“mypassword”@localhost:8042/ “destination ip without port”
Traceback (most recent call last):
File “Replicate.py”, line 106, in
for study in DoGetJson(‘%s/studies’ % SOURCE):
File “Replicate.py”, line 100, in DoGetJson
return _DecodeJson(DoGetString(url))
File “Replicate.py”, line 66, in DoGetString
headers = CreateHeaders(parsedUrl)
File “Replicate.py”, 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\base64.py”, 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?

Error:

Sending study f6c606ae-4ecacfdd-904cfc3d-da9c47b9-40801e21…
Traceback (most recent call last):
File “Replicate.py”, line 110, in
DoPostDicom(‘%s/instances’ % TARGET, dicom)
File “Replicate.py”, 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):
https://book.orthanc-server.com/faq/orthanc-storage.html#direct-access

https://book.orthanc-server.com/faq/scalability.html#exclusive-access-to-the-db

Are you looking for the “generic replication” process?https://book.orthanc-server.com/users/replication.html#generic-replication

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