2
2
3
3
This App creates and stores backup images of your Nextcloud.
4
4
5
+ _ (documentation is still in writing)_
6
+
5
7
- [ Important notes] ( #notes )
6
8
- [ Restoring Points] ( #restoring-point )
7
9
- [ Hardware Requirement] ( #hardware )
@@ -10,6 +12,7 @@ This App creates and stores backup images of your Nextcloud.
10
12
- [ Important details about your data] ( #important )
11
13
- [ Upload to External Storages] ( #external-storages )
12
14
- [ AppData on External Storage] ( #external-appdata )
15
+ - [ Restoring a backup] ( $restoring )
13
16
- [ Available ` occ ` commands] ( #occ )
14
17
15
18
<a name =" notes " ></a >
@@ -19,8 +22,8 @@ This App creates and stores backup images of your Nextcloud.
19
22
- ** Read the full documentation** ,
20
23
- During the generation of the backup, the app will put your instance in ` maintenance mode ` ,
21
24
- This app generates a lot of data and can fill your hard drive,
22
- - By default ** your data are encrypted** , meaning you ** will need to export** the App configuration ** as
23
- soon as possible** or you will ** not** be able to ** decrypt your backups** .
25
+ - By default, ** your data are encrypted** meaning you ** will need to export** the configuration of the
26
+ App ** as soon as possible** or you will ** not** be able to ** decrypt your backups** .
24
27
25
28
<a name =" restoring-point " ></a >
26
29
@@ -29,22 +32,22 @@ This App creates and stores backup images of your Nextcloud.
29
32
A restoring point is an image of your Nextcloud at a specific time. A restoring point can be:
30
33
31
34
- '** Full** ' (or Complete) and contains a backup of :
32
- * the instance of Nextcloud,
33
- * the apps of the Nextcloud (` apps/ ` and ` custom_apps/ ` ),
35
+ * the instance of Nextcloud, its apps and ` config/config.php `
34
36
* A dump of the database,
35
37
* the local folder defined as ` data ` of the Nextcloud.
36
38
37
39
38
40
- '** Partial** ' (or Incremental) that contains a backup of :
39
- * the instance of Nextcloud,
40
- * the apps of the Nextcloud,
41
- * A dump of the database,
42
- * local data that have been modified/generated since the last ** Full Backup**
41
+ * the instance of Nextcloud, its apps and ` config/config.php `
42
+ * A dump of the database,
43
+ * local data that have been modified/generated since the last ** Full Backup**
43
44
44
45
### What data are available in a Restoring Point
45
46
46
- Please note that the ** Backup App** will not store ALL data from your Nextcloud. As an example, remote
47
- files won't be stored.
47
+ Let's first start with the fact that the ** Backup App** will not store ** ALL** data from your
48
+ Nextcloud.
49
+ As an example, remote files won't be stored.
50
+
48
51
This is a list of what can be restored and what cannot be restored when using the ** Backup App** :
49
52
50
53
A restoring point will store
@@ -53,9 +56,9 @@ A restoring point will store
53
56
- the configuration in ` config/config.php ` ,
54
57
- the ` apps/ ` folder and any other ` custom_apps/ `
55
58
- your local ` data/ ` , defined by ` 'datadirectory' ` in ` config/config.php ` ,
56
- - original absolute paths ,
57
- - A full ` sqldump ` of your database ,
58
- - List of files and localisation within the backup .
59
+ - a full ` sqldump ` of your database ,
60
+ - list of files and localisation within the backup ,
61
+ - metadata about the instance .
59
62
60
63
A restoring point will ** NOT** store:
61
64
@@ -69,14 +72,15 @@ backup:
69
72
- Version of your Nextcloud,
70
73
- The ID of the parent backup in case of partial backup,
71
74
- The list of data file that compose the restoring point, the format for this data depends on the current
72
- status of the restoring point (packed/unpacked) and the settings (compression, encryption)
73
- - Checksum for each files of the backup itself,
75
+ status of the restoring point (packed/unpacked) and the settings (compression, encryption),
76
+ - Absolute paths for each data file,
77
+ - Checksum for each file of the backup itself,
74
78
- The date of the restoring point,
75
79
- Comments,
76
80
- Information related to the health of the files during the last check.
77
81
78
- While the file ` restoring-point.data ` confirm the integrity of all files and parts of the backup, it is
79
- still possible to generate a restoring point based on the available files. However :
82
+ While the file ` restoring-point.data ` is require to confirm the integrity of all files and parts of the
83
+ backup, it is still possible to generate a restoring point based on the available files. However :
80
84
81
85
- there is no way to confirm the integrity of the restoring point,
82
86
- the restoring process will require some knowledge from the admin about the original infrastructure from
@@ -86,8 +90,7 @@ still possible to generate a restoring point based on the available files. Howev
86
90
87
91
- Upload the files of your restoring point on your instance of Nextcloud with the Backup App installed,
88
92
in a ** specific** folder in your Files.
89
- - At the root of this ** specific** folder, create a file named ` restoring-point.data ` and add this
90
- content inside:
93
+ - At the root of this ** specific** folder, create a file named ` restoring-point.data ` with this content:
91
94
92
95
{"action": "generate", "id": "20211023234222-full-TFTBQewCEdcQ3cS"}
93
96
@@ -122,22 +125,20 @@ itself.
122
125
123
126
### The timing
124
127
125
-
126
128
From the ** Admin Settings** /** Backup** page, you can configure the time slot and the rate for the
127
129
generation of your future backups.
128
130
129
131
![ Settings Schedule] ( screenshots/settings_schedule.png )
130
132
131
-
132
133
The time slot define the time of the day the Backup App might generate a backup, it is based on the local
133
134
time on the server.
134
135
135
136
Keep in mind that your instance will be in ` maintenance mode ` for the duration of the generation of the
136
137
backup. This is the reason why, by default, ** Full Backup** will only be started during the week-end,
137
138
while ** Partial Backup** are also run during week days.
138
139
139
- If you scroll down to the bottom of this page, you can have an estimation of the next backup based on
140
- your settings:
140
+ If you scroll down to the bottom of this page, you can have an estimation of the date for your next
141
+ backup based on your settings:
141
142
142
143
![ Settings Next Point] ( screenshots/settings_next_point.png )
143
144
@@ -157,32 +158,41 @@ By default, the `appdata` folder of the Backup App is located in the same folder
157
158
data of your instance defined in ` datadirectory ` . It is estimated that the ` Backup App ` needs 65% of the
158
159
available diskspace of the ` datadirectory `
159
160
160
- In case there is no enough space, you can [ #external-appdata] (mount an External Storage) and move
161
+ In case there is not enough space, you can [ #external-appdata] (mount an External Storage) and move
161
162
the ` appdata ` folder of the ** Backup app** there.
162
163
163
164
### The second pass (the packing process)
164
165
165
- ![ Settings Packing] ( screenshots/settings_packing.png )
166
-
167
166
The second pass does not require to put your instance in ` maintenance mode ` . The 2nd pass consist in the
168
167
packing of the restoring point and eventually its upload on external storage.
169
168
169
+ You can configure the type of packing in the Admin Settings of the app
170
+
171
+ ![ Settings Packing] ( screenshots/settings_packing.png )
172
+
170
173
The packing will list each ` chunk ` of your backup and:
171
174
172
175
- Compress them (if enabled),
173
176
- Split the result in multiple files (named ` part ` ) of 100MB,
174
177
- Encrypt each ` part ` (if enabled),
175
178
- Once completed without issue, remove the original zip file of the ` chunk ` to free space.
176
179
177
- <a name =" export " ></a >
180
+
181
+ <a name =" handle-external-storages " ></a >
178
182
179
183
### Storing on a different hard drive
180
184
181
- ![ Settings External ] ( screenshots/settings_upload.png )
185
+ Once packed, restoring points can be stored on a different location. Locally or remotely.
182
186
183
- Once packed, restoring points can be stored on a different hard drive. Locally or remotely.
184
- If [ enabled and configured] ( #upload-to-external-storages ) , the Backup App will store and manage your
185
- restoring points on the ** External Storage**
187
+ if [ configured] ( #external-storages ) , the Backup App will start storing your restoring points externally,
188
+ and check their integrity every day.
189
+
190
+ The uploading process will check that each ` part ` of the packed restoring point are healthy, based on the
191
+ checksum stored in the ` metadata ` file and will retry to upload any faulty ` part ` .
192
+ On top of that, the data itself from the ` metadata ` file are signed, making the Backup App able to
193
+ confirm the full integrity of the backup.
194
+
195
+ <a name =" export " ></a >
186
196
187
197
## Exporting your configuration
188
198
@@ -221,6 +231,25 @@ restoring points on the **External Storage**
221
231
222
232
## Upload to External Storages
223
233
234
+ Uploading your packed restoring point on one (or multiple) external storages is the perfect solution when
235
+ facing a huge loss of data from your disk whether it is of human or hardware origin.
236
+
237
+ Those external data are [ fully managed] ( #handle-external-storages ) by the app itself.
238
+
239
+ The configuration is done in 2 steps:
240
+
241
+ - The first step is to setup a folder from the ** External Storage** Settings Page, it is strongly adviced
242
+ to limit the availability of the folder to the ` admin ` group only,
243
+
244
+ ![ Settings External] ( screenshots/settings_external_store.png )
245
+
246
+ - the second step is done in the ** Backup** Settings Page, the configured External Storage should be
247
+ displayed in the listing of available storage location,
248
+
249
+ ![ Settings External] ( screenshots/settings_external_folder.png )
250
+
251
+ - set the path where your backup files will be stored.
252
+
224
253
<a name =" external-appdata " ></a >
225
254
226
255
## AppData on External Storage
@@ -237,6 +266,93 @@ its data:
237
266
run ` ./occ backup:external:appdata ` and follow instruction to select the configured external storage, and
238
267
configure the path to the right folder.
239
268
269
+ <a name =" restoring " ></a >
270
+
271
+ ## Restoring a backup
272
+
273
+ You can restore a single file or the whole instance to a previous state:
274
+
275
+ ./occ backup:point:restore <pointId> [--file <filename>] [--data <dataPack>] [--chunk chunkName]
276
+
277
+ Please note that you can go back to a previous backup of your instance from any Nextcloud compatible with
278
+ the Backup App. There is no need to install the exact same version as it will be reverted to the one used
279
+ when creating the Restoring Point. Meaning that you can fully restore your instance of Nextcloud even if
280
+ you lost your harddrive, as long as you kept a copy of the Restoring Point (upload to another remote
281
+ instance)
282
+
283
+ - install nextcloud compatible with the Backup App,
284
+ - ./occ app: enable backup
285
+ - if the backup are encrypted (or to confirm integrity of files): `./occ backup:setup:
286
+ import [ --key <key >] < ~ /backup_setup
287
+ - if the backup are on an external storage:
288
+ * ` ./occ app:enable files_external `
289
+ * add the [ external storage] ( #upload-to-external-storages )
290
+ * ` ./occ backup:external:add ` and follow instruction, add the path to the backup you want to reach
291
+ * you should be able to see the restoring point the external storage
292
+ - ` ./occ backup:point:list `
293
+
294
+ ```
295
+ $ ./occ backup:point:list
296
+ - retreiving data from local
297
+ - retreiving data from external:3
298
+ > found RestoringPoint 20211031232710-full-Tu4H6vOtxKoLLb9
299
+ > found RestoringPoint 20211101014009-full-QeTziynggIuaaD2
300
+ +---------------------------------------+---------------------+--------+---------+-----------------------------+------------+--------------+--+
301
+ | Restoring Point | Date | Parent | Comment | Status | Instance | Health | |
302
+ +---------------------------------------+---------------------+--------+---------+-----------------------------+------------+--------------+--+
303
+ | A 20211031232710-full-Tu4H6vOtxKoLLb9 | 2021-10-31 23:27:10 | | beta2 | packed,compressed,encrypted | external:3 | 12H, 23M ago | |
304
+ | 20211101014009-full-QeTziynggIuaaD2 | 2021-11-01 01:40:09 | | | packed,compressed,encrypted | external:3 | 10H, 53M ago | |
305
+ +---------------------------------------+---------------------+--------+---------+-----------------------------+------------+--------------+--+
306
+ ```
307
+
308
+ * download the restoring point
309
+
310
+ ```
311
+ $ ./occ backup:point:download --external 3 20211031232710-full-Tu4H6vOtxKoLLb9
312
+ > downloading metadata
313
+ check health status: 0 correct, 43 missing and 0 faulty files
314
+ * Downloading data/data-0540e4d6-9d7f-4c84-a8d8-ca40764257d1/00001-B57XWKJQe5Xg1sd: ok
315
+ * Downloading data/data-0540e4d6-9d7f-4c84-a8d8-ca40764257d1/00002-PXHPeS6t6OXFwkP: ok
316
+ [...]
317
+ ```
318
+
319
+ * unpack the restoring point
320
+
321
+ ```
322
+ $ ./occ backup:point:unpack 20211031232710-full-Tu4H6vOtxKoLLb9
323
+ Unpacking Restoring Point 20211031232710-full-Tu4H6vOtxKoLLb9
324
+ > lock and set status to unpacking
325
+ > Browsing RestoringData data
326
+ > Unpacking RestoringChunk data-0540e4d6-9d7f-4c84-a8d8-ca40764257d1: proceeding
327
+ * copying parts to temp files
328
+ - 00001-B57XWKJQe5Xg1sd: /tmp/phpNnYCbZ
329
+ - 00002-PXHPeS6t6OXFwkP: /tmp/phpYqRSPW
330
+ [...]
331
+ ```
332
+
333
+ * for each data pack, you will be prompt to choose the location of the extraction.
334
+ * If a sqldump is available, you will be prompt to use the current configuration from the instance, or
335
+ use another database
336
+
337
+ * if the information from the file ` config/config.php ` are in conflict with the path or sql settings
338
+ specified during the extraction, you will be notified that the restoring process wants to update
339
+ them.
340
+
341
+ ```
342
+ $ ./occ backup:point:restore 20211031232710-full-Tu4H6vOtxKoLLb9
343
+ Restoring Point: 20211031232710-full-Tu4H6vOtxKoLLb9
344
+ Date: 2021-10-31 23:27:10
345
+ Checking Health status: ok
346
+
347
+
348
+ WARNING! You are about to initiate the complete restoration of your instance!
349
+ All data generated since the creation of the selected backup will be lost...
350
+
351
+ Your instance will come back to a previous state from 13 hours, 17 minutes and 48 seconds ago.
352
+
353
+ Do you really want to continue this operation ? (y/N)
354
+ ```
355
+
240
356
<a name =" occ " ></a >
241
357
242
358
## Available ` occ ` commands:
@@ -332,18 +448,6 @@ appdata folder: data/appdata_qwerty123/backup/
332
448
333
449
./occ backup:point:details <pointId>
334
450
335
- ## Restoration
336
-
337
- You can restore a single file or the whole instance to a previous state:
338
-
339
- ./occ backup:point:restore <pointId> [--file <filename>] [--data <dataPack>] [--chunk chunkName]
340
-
341
- Please note that you can go back to a previous backup of your instance from any Nextcloud compatible with
342
- the Backup App. There is no need to install the exact same version as it will be reverted to the one used
343
- when creating the Restoring Point. Meaning that you can fully restore your instance of Nextcloud even if
344
- you lost your harddrive, as long as you kept a copy of the Restoring Point (upload to another remote
345
- instance)
346
-
347
451
## Exporting configuration
348
452
349
453
This is an important step of your configuration of the Backup App Some information will be needed in case
@@ -365,12 +469,24 @@ generated during the export of your setup needs to be stored somewhere safe!
365
469
366
470
./occ backup:setup:import [--key <key>] < ~/backup_setup.json
367
471
472
+ ## Questions ?
473
+
474
+ ** - Can the app be used to migrate an instance of Nextcloud ?**
368
475
476
+ Yes, during the restoration you can change the absolute path of your files and the configuration relative
477
+ to the database.
478
+ No, you cannot switch the type of the database server (mysql, postgres, ...).
369
479
370
- ### Known issues, because _ beta_ :
480
+ However, the app should not be used to duplicate setup in production as each instance will be fully
481
+ identical (` instanceid ` , ...).
371
482
372
- * custom_apps are not included in the backup.
373
- * Zip's integrity are not checked during unpack, might result in a lose of data when decrypting with the wrong key when restoring a backup with lost metadata file.
374
- * When removed from the files_external, an external storage will not be removed from the backup app's list of external folder
375
- * When restoring in another database, the process will fail if the database does not exist.
483
+ ## Known issues, because _ beta_ :
376
484
485
+ * custom_apps are not included in the backup.
486
+ * Zip's integrity are not checked during unpack, might result in a lose of data when decrypting with the
487
+ wrong key when restoring a backup with lost metadata file.
488
+ * When removed from the files_external, an external storage will not be removed from the backup app's
489
+ list of external folder
490
+ * When restoring in another database, the process will fail if the database does not exist.
491
+ * When adding a new external storage from the files_external, the folder needs to be mounted using the
492
+ Files App. Browsing the root folder should be enough.
0 commit comments