0
|
1 .. highlight:: bash
|
|
2 .. _replication:
|
|
3
|
|
4 Replication and upgrade
|
|
5 =======================
|
|
6
|
|
7 This page explains how to replicate the content of one instance of
|
|
8 Orthanc to another instance of Orthanc. This is useful to **upgrade**
|
|
9 between :ref:`versions of the database schema <db-versioning>`, or to
|
|
10 create **mirrored DICOM servers**.
|
|
11
|
|
12 Note that if you only want to automatically upgrade the database for
|
|
13 successive versions of Orthanc, you most probably only have to add the
|
|
14 ``--upgrade`` command-line option while starting Orthanc.
|
|
15
|
|
16
|
|
17 Direct access to the filesystem
|
|
18 -------------------------------
|
|
19
|
|
20 The most direct way to replicate consists in using the
|
|
21 `ImportDicomFiles
|
|
22 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/ImportDicomFiles/ImportDicomFiles.py>`_
|
|
23 script of the Orthanc distribution. For instance, the following
|
|
24 command would recursively explore the content of the ``OrthancStorage``
|
|
25 folder (where Orthanc stores its DICOM files by default), and send
|
|
26 each DICOM file inside this folder to the instance of Orthanc whose
|
|
27 REST API is listening on ``http://192.168.0.2:8042``::
|
|
28
|
|
29 $ python ImportDicomFiles.py 192.168.0.2 8042 OrthancStorage
|
|
30
|
|
31 This method will only succeed if:
|
|
32
|
|
33 * The source Orthanc uses the default SQLite back-end of Orthanc (and
|
|
34 not the `PostgreSQL plugin
|
|
35 <http://www.orthanc-server.com/static.php?page=postgresql>`_, for
|
|
36 instance),
|
|
37 * You have command-line access to the source Orthanc, and
|
|
38 * The transparent :ref:`compression` of the DICOM instances is
|
|
39 disabled (cf. option ``StorageCompression`` in the
|
|
40 :ref:`configuration file <configuration>`).
|
|
41
|
|
42 Generic replication
|
|
43 -------------------
|
|
44
|
|
45 If you cannot use the first method, you can use the `Replicate
|
|
46 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/Replicate.py>`_
|
|
47 script of the Orthanc distribution. This script will use the REST API
|
|
48 of both the source and target instances of Orthanc. For instance::
|
|
49
|
|
50 $ python Replicate.py http://orthanc:password@localhost:8042/ http://192.168.0.2/
|
|
51
|
|
52 Obviously, contrarily to the first method, the source instance of
|
|
53 Orthanc must be up and running during the replication.
|