aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2022-12-19 21:36:05 +0100
committerDaniel Schadt <kingdread@gmx.de>2022-12-19 21:36:05 +0100
commit11768581cbe71a1eaf197204b6362d07da4d6c49 (patch)
tree63b8251c5700c1b3ecf98dcf8e47dade528f06e4 /doc
parent7a5627f4e1863d3439519c4df2a2d400eaad44ed (diff)
downloadfietsboek-11768581cbe71a1eaf197204b6362d07da4d6c49.tar.gz
fietsboek-11768581cbe71a1eaf197204b6362d07da4d6c49.tar.bz2
fietsboek-11768581cbe71a1eaf197204b6362d07da4d6c49.zip
use fietsupdate in documentation about backups
This should be preferred over dealing with raw alembic now.
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.