From 859d073a7e5335b8df49befa91c3e26ae0ed0f47 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Thu, 10 Oct 2024 10:34:53 +0200 Subject: [PATCH] Backup instruction moved to piki --- README.md | 21 --------------------- pages/help.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 50a0cd1..1f5a5e8 100644 --- a/README.md +++ b/README.md @@ -60,24 +60,3 @@ Now there are two ways to finalise your configuration. The first way is for a te ###Start the Server python manage.py runserver - - -## Backup -### Create Backup files - source venv/bin/activate - python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions -e pages --indent 2 > dump_pages.json - tar -cvzf dump_data.tgz data/media data/pages data/media - -### Restore Backup - - source venv/bin/activate - -If you are starting without a database, you need to create one - - python manage.py migrate - -Afterward add data step by step to the database. - - python manage.py loaddata dump_pages.json - rm -rf data/pages data/media - tar -xvzf dump_data.tgz diff --git a/pages/help.py b/pages/help.py index e70058b..1b8bfff 100644 --- a/pages/help.py +++ b/pages/help.py @@ -12,6 +12,9 @@ MAIN = mycreole.render_simple(_( **piki** is a minimal wiki implemented with python and django. +== Get it +For download and installation instructions, visit [[https://git.mount-mockery.de/application/piki]]. + == Help * [[creole|Creole Markup Language]] * [[access|Access Control for the site content]] @@ -79,11 +82,37 @@ This search pattern can also be combined with other search text via logical oper * [[/search/?q=modified_time%3A%5B-5d+to+now%5D| modified_time:[-5d to now] ]] results in a list of all pages which have been modified within the last 5 days. """)) +BACKUP = mycreole.render_simple(_( + """ += Backup +With the following command, you create a backup of your piki. It contains out of two files. {{{pages.json}}} \ +includes userdata, bottombar configurations and so on. The pages are included in {{{pages.tgz}}}. +{{{ +$ cd +$ source venv/bin/activate +$ python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions -e pages --indent 2 > pages.json +$ tar -czf pages.tgz data/pages data/media +}}} + += Recovery +Be carefull with these commands. They delete all the data, before recovering from the backup files! +{{{ +$ cd +$ source venv/bin/activate +$ rm db.sqlite3 +$ rm -rf data/pages data/media +$ python manage.py migrate +$ python manage.py loaddata pages.json +$ tar -xvzf pages.tgz +}}} +""")) + help_pages = { 'main': MAIN, 'creole': CREOLE, 'access': ACCESS, 'search': SEARCH, + 'backup': BACKUP } @@ -93,6 +122,7 @@ def actionbar(context, request, current_help_page=None, **kwargs): ('2', 'Creole'), ('3', 'Access'), ('4', 'Search'), + ('5', 'Backup'), ) for num, name in actionbar_entries: context[context.ACTIONBAR].append_entry(