annotate Sphinx/source/users/backup.rst @ 660:a6e371768a70

dicom-as-json
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Apr 2021 12:41:31 +0200
parents 011b01ccf52d
children c10fc0838f58
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _backup:
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 Backup
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 ======
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 The way to backup Orthanc depends on the database back-end that is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 used. In any case, you of course have to backup your
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 :ref:`configuration file <configuration>`.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 SQLite
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 ------
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 By default, Orthanc uses SQLite to store its database. In this case,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 all the DICOM files together with the SQLite index are stored directly
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 in the filesystem. The backup procedure works as follows:
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 1. Stop Orthanc.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 2. Copy the following 3 elements:
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * Your configuration file.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * The DICOM files (by default, the subdirectories of the
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 ``OrthancStorage`` folder next to the configuration file).
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * The SQLite index (by default, the ``OrthancStorage/index*`` files
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 next to the configuration file).
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 3. Restart Orthanc.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 It is mandatory to stop Orthanc, as the Orthanc core makes the
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 assumption that it is the only process to access the SQLite database
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 at any time.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 Karsten Hilbert provided us with a `sample backup script
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 <https://github.com/jodogne/OrthancContributed/blob/master/Scripts/Backup/2014-01-31-KarstenHilbert.sh>`__
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 for the official Debian package of Orthanc that automates this backup
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 procedure. Note that in this script, the call to the SQLite
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 command-line tool is used to force the `WAL replay
358
011b01ccf52d fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 307
diff changeset
37 <https://www.sqlite.org/wal.html>`__. This manual replay should not be
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 necessary for Orthanc >= 0.7.3.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
154
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
41 PostgreSQL and MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
42 --------------------
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 The default SQLite engine is well adapted for DICOM routing or for
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 image buffering tasks, but not for enterprise scenarios. In such
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 cases, you are highly recommended to use the `PostgreSQL back-end
358
011b01ccf52d fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 307
diff changeset
47 <https://www.orthanc-server.com/static.php?page=postgresql>`__ or the
154
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
48 `MySQL/MariaDB back-end
358
011b01ccf52d fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 307
diff changeset
49 <https://www.orthanc-server.com/static.php?page=mysql>`__.
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 If using PostgreSQL, you can do hot backups (i.e. while Orthanc is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 running), and you benefit from all the flexibility of PostgreSQL
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 backup. These procedures are out of the scope of this manual. Please
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 check the `official backup and restore manual
358
011b01ccf52d fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 307
diff changeset
55 <https://www.postgresql.org/docs/devel/backup.html>`__.
154
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
56
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
57 Similar backup procedures are available for MySQL and MariaDB as
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
58 well. Please check the official manual about `database backup methods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
59 <https://dev.mysql.com/doc/refman/8.0/en/backup-methods.html>`__.
307
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 154
diff changeset
60
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 154
diff changeset
61 Here are some contributed documents:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 154
diff changeset
62
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 154
diff changeset
63 * `Backup for Windows 10, Orthanc and PostgreSQL plugin <https://blog.goo.ne.jp/wakida_ortho/e/3eb557fd134cf6136d5ba66cf72fd85a>`__ (in Japanese, 2020-02-02).