diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-07-22 23:40:20 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-07-22 23:45:34 +0200 |
commit | 109332ee71869f090a472bd2fb455f2d3f48b91e (patch) | |
tree | 21b3b00ffd2bb8d7eb982869cc9560c78663e4e3 /doc/administration/backup.rst | |
parent | 4a67a98222443e286f8db9650327250021c76ef5 (diff) | |
parent | d2a8a75667e7e2ce5c7bdd7fd351136b70ec7913 (diff) | |
download | fietsboek-109332ee71869f090a472bd2fb455f2d3f48b91e.tar.gz fietsboek-109332ee71869f090a472bd2fb455f2d3f48b91e.tar.bz2 fietsboek-109332ee71869f090a472bd2fb455f2d3f48b91e.zip |
Merge branch 'image-upload'
Diffstat (limited to 'doc/administration/backup.rst')
-rw-r--r-- | doc/administration/backup.rst | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/doc/administration/backup.rst b/doc/administration/backup.rst index 9566e38..3973298 100644 --- a/doc/administration/backup.rst +++ b/doc/administration/backup.rst @@ -15,10 +15,20 @@ case data is lost due unforseen reasons. Backup ------ -All of the Fietsboek data is contained in the database. You should refer to the -manual of your DBMS to see what the procedure for a backup is. Using the -preferred way for your DBMS ensures that your backup represents a consistent -state of the database. +The Fietsboek data lives in two places: Most of it is saved in the database, +while track images and other "big files" are saved in the data directory. + +You should refer to the manual of your DBMS to see what the procedure for a +backup is. Using the preferred way for your DBMS ensures that your backup +represents a consistent state of the database. + +After backing up the database, you should back up the data directory with a +tool of your choice, for example by using ``tar``, ``rsync`` or a proper backup +tool like ``borg``: + +.. code:: bash + + tar -czf backup.tar.gz path/to/data/dir In addition to the actual data, you should also note down the Fietsboek version and the database schema version, as backups can only be restored to the same @@ -42,7 +52,7 @@ Note those value in addition to your backup. Restore ------- -The restoration process works in three steps: +The restoration process works in four steps: First, we ensure that we are on the correct Fietsboek version. If you are using ``git``, this can be done with ``git checkout``: @@ -57,5 +67,9 @@ Then, we get the database schema to the right version: .venv/bin/alembic -c production.ini upgrade NOTED_ALEMBIC_VERSION_HERE -Finally, we can restore the data. This step is dependent on the DBMS that you, -therefore you should consult its documentation. +Now, we can restore the data in the database. This step is dependent on the +DBMS that you, therefore you should consult its documentation. + +Finally, we can restore the data directory. This step depends on how you chose +to back up the data directory earlier. In the case of ``tar``, you can simply +extract the archive to the right location. |