Browse Source

Backup instruction moved to piki

master
Dirk Alders 2 months ago
parent
commit
859d073a7e
2 changed files with 30 additions and 21 deletions
  1. 0
    21
      README.md
  2. 30
    0
      pages/help.py

+ 0
- 21
README.md View File

60
 
60
 
61
 ###Start the Server
61
 ###Start the Server
62
     python manage.py runserver
62
     python manage.py runserver
63
-
64
-
65
-## Backup
66
-### Create Backup files
67
-    source venv/bin/activate
68
-    python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions -e pages --indent 2 > dump_pages.json
69
-    tar -cvzf dump_data.tgz data/media data/pages data/media
70
-
71
-### Restore Backup
72
-
73
-    source venv/bin/activate
74
-
75
-If you are starting without a database, you need to create one
76
-
77
-    python manage.py migrate
78
-
79
-Afterward add data step by step to the database.
80
-
81
-    python manage.py loaddata dump_pages.json
82
-    rm -rf data/pages data/media
83
-    tar -xvzf dump_data.tgz

+ 30
- 0
pages/help.py View File

12
 
12
 
13
 **piki** is a minimal wiki implemented with python and django.
13
 **piki** is a minimal wiki implemented with python and django.
14
 
14
 
15
+== Get it
16
+For download and installation instructions, visit [[https://git.mount-mockery.de/application/piki]].
17
+
15
 == Help
18
 == Help
16
 * [[creole|Creole Markup Language]]
19
 * [[creole|Creole Markup Language]]
17
 * [[access|Access Control for the site content]]
20
 * [[access|Access Control for the site content]]
79
 * [[/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.
82
 * [[/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.
80
 """))
83
 """))
81
 
84
 
85
+BACKUP = mycreole.render_simple(_(
86
+    """
87
+= Backup
88
+With the following command, you create a backup of your piki. It contains out of two files. {{{pages.json}}} \
89
+includes userdata, bottombar configurations and so on. The pages are included in {{{pages.tgz}}}.
90
+{{{
91
+$ cd <PROJECT_DIRECTORY>
92
+$ source venv/bin/activate
93
+$ python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions -e pages --indent 2 > pages.json
94
+$ tar -czf pages.tgz data/pages data/media
95
+}}}
96
+
97
+= Recovery
98
+Be carefull with these commands. They delete all the data, before recovering from the backup files!
99
+{{{
100
+$ cd <PROJECT_DIRECTORY>
101
+$ source venv/bin/activate
102
+$ rm db.sqlite3
103
+$ rm -rf data/pages data/media
104
+$ python manage.py migrate
105
+$ python manage.py loaddata pages.json
106
+$ tar -xvzf pages.tgz
107
+}}}
108
+"""))
109
+
82
 help_pages = {
110
 help_pages = {
83
     'main': MAIN,
111
     'main': MAIN,
84
     'creole': CREOLE,
112
     'creole': CREOLE,
85
     'access': ACCESS,
113
     'access': ACCESS,
86
     'search': SEARCH,
114
     'search': SEARCH,
115
+    'backup': BACKUP
87
 }
116
 }
88
 
117
 
89
 
118
 
93
         ('2', 'Creole'),
122
         ('2', 'Creole'),
94
         ('3', 'Access'),
123
         ('3', 'Access'),
95
         ('4', 'Search'),
124
         ('4', 'Search'),
125
+        ('5', 'Backup'),
96
     )
126
     )
97
     for num, name in actionbar_entries:
127
     for num, name in actionbar_entries:
98
         context[context.ACTIONBAR].append_entry(
128
         context[context.ACTIONBAR].append_entry(

Loading…
Cancel
Save