aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2022-12-20 20:17:59 +0100
committerDaniel Schadt <kingdread@gmx.de>2022-12-20 20:17:59 +0100
commit7a60619d3f6fd523d42f50753436f3b7e7d72ca4 (patch)
tree5a5afe7dda6631100f2f52fac0d1935f7627026d /doc
parentd5830f4000bf8f96d821fd3e93f04898af03132e (diff)
parent0e0a7e4326a592a6b99ad590e3397e6ddaeaf93a (diff)
downloadfietsboek-7a60619d3f6fd523d42f50753436f3b7e7d72ca4.tar.gz
fietsboek-7a60619d3f6fd523d42f50753436f3b7e7d72ca4.tar.bz2
fietsboek-7a60619d3f6fd523d42f50753436f3b7e7d72ca4.zip
Merge branch 'gpx-exodus'
Diffstat (limited to 'doc')
-rw-r--r--doc/administration/backup.rst40
1 files changed, 35 insertions, 5 deletions
diff --git a/doc/administration/backup.rst b/doc/administration/backup.rst
index 3973298..fb379bc 100644
--- a/doc/administration/backup.rst
+++ b/doc/administration/backup.rst
@@ -34,20 +34,36 @@ 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
version!
-To view the fietsboek version in case you are using ``git``, you can use the
+To view the Fietsboek version in case you are using ``git``, you can use the
following command:
.. code:: bash
git rev-parse HEAD
+If you installed Fietsboek via ``pip`` or other means, you can use one of the
+following to see the version:
+
+.. code:: bash
+
+ .venv/bin/pip show fietsboek
+ .venv/bin/fietsctl version
+
+To view the data version, use ``fietsupdate``:
+
+.. code:: bash
+
+ .venv/bin/fietsupdate status -c development.ini
+
To view the database schema version, use ``alembic``:
.. code:: bash
.venv/bin/alembic -c development.ini current
-Note those value in addition to your backup.
+Note those values (Fietsboek version, data version, database schema version) in
+addition to your backup, as you will need them when restoring data later or
+when troubleshooting the restoration process.
Restore
-------
@@ -55,17 +71,31 @@ Restore
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``:
+``git``, this can be done with ``git checkout`` before installing it:
.. code:: bash
git checkout NOTED_GIT_VERSION_HERE
-Then, we get the database schema to the right version:
+If you have installed Fietsboek via ``pip``, you can use it to request a
+specific version:
.. code:: bash
- .venv/bin/alembic -c production.ini upgrade NOTED_ALEMBIC_VERSION_HERE
+ .venv/bin/pip install "fietsboek==vX.Y.Z"
+
+Next, we run the data migrations:
+
+.. code:: bash
+
+ .venv/bin/fietsupdate update -c development.ini VERSION_FROM_EARLIER
+
+We can verify that the database has the correct schema version by using the
+same command from earlier and comparing its output to the noted value:
+
+.. code:: bash
+
+ .venv/bin/alembic -c development.ini current
Now, we can restore the data in the database. This step is dependent on the
DBMS that you, therefore you should consult its documentation.