Backup / Restore funktioniert nicht (richtig)

Hallo zusammen,

ich möchte eine Backup-Routine implementieren und habe zum Testen eine komplett neue Nextcloud auf einem vServer installiert. Ich habe die Installation analog folgendem Tutorial durchgefĂŒhrt.

Das Backup lÀuft auf einem gemounteten ftp-Server und wurde mit diesen Skripts

https://codeberg.org/DecaTec/Nextcloud-Backup-Restore

gemĂ€ĂŸ dem Tutorial ausgefĂŒhrt.

Leider ergeben sich einige Fehlermeldungen im Verlauf des Skripts und nach AusfĂŒhren des Restore ist die Nextcloud nicht mehr zu erreichen.

Hier der Output des Backups:

Backup directory: /mnt/my_ftp/
16:06:42: Set maintenance mode for Nextcloud

Maintenance mode enabled
Done

16:06:44: Stopping web server

Done

16:06:46: Creating backup of Nextcloud file directory

/bin/sh: 1: pigz: not found
tar: /mnt/my_ftp//20210928_160640//nextcloud-filedir.tar.gz: Wrote only 4096 of 10240 bytes
tar: Child returned status 127
tar: Error is not recoverable: exiting now
Done

16:06:47: Creating backup of Nextcloud data directory

Ignoring updater backup directory
/bin/sh: 1: pigz: not found
tar: /mnt/my_ftp//20210928_160640//nextcloud-datadir.tar.gz: Wrote only 4096 of 10240 bytes
tar: Child returned status 127
tar: Error is not recoverable: exiting now
Done

16:06:47: Backup Nextcloud database (MySQL/MariaDB)

mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: ‘Access denied; you need (at least one of) the PROCESS privilege(s) for this operation’ when trying to dump tablespaces
Done

16:06:50: Starting web server

Done

16:06:51: Switching off maintenance mode

Maintenance mode disabled
Done

DONE!

Und hier der Output des Restore Skripts:

Backup directory: /mnt/my_ftp/
16:24:05: Set maintenance mode for Nextcloud

Maintenance mode enabled
Done

16:24:07: Stopping web server

Done

16:24:08: Deleting old Nextcloud file directory

Done

16:24:10: Deleting old Nextcloud data directory

Done

16:24:10: Restoring Nextcloud file directory

tar (child): pigz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Done

16:24:11: Restoring Nextcloud data directory

tar (child): pigz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Done

16:24:11: Dropping old Nextcloud DB

mysql: [Warning] Using a password on the command line interface can be insecure.
Done

16:24:14: Creating new DB for Nextcloud

mysql: [Warning] Using a password on the command line interface can be insecure.
Done

16:24:14: Restoring backup DB

mysql: [Warning] Using a password on the command line interface can be insecure.
Done

16:24:18: Starting web server

Done

16:24:18: Setting directory permissions

Done

16:24:18: Updating the system data-fingerprint

Could not open input file: /var/www/nextcloud/occ
Done

16:24:19: Switching off maintenance mode

Could not open input file: /var/www/nextcloud/occ
Done

DONE!
16:24:19: Backup 20210928_160640 successfully restored.

Ich habe nach dem Restore Nextcloud noch einmal installiert und konnte dann auch wieder darauf zugreifen. Der Restore hat an sich funktioniert, da alle meine Änderungen nach dem Backup wieder zurĂŒck gestellt waren aber die Nextcloud selbst war leider kaputt

Hat jemand eine Idee was da bei mir falsch lÀuft?

Viele GrĂŒĂŸe!

Okay, habs gefunde: Es ist wohl ein Fehler nach Update von MySQL
 das nc-backup.sh muss bei

msqldump

um

–no-tablespaces

ergÀnzt werden! Hoffe es hilft sonst noch jemandem

Ich möchte ehrlich sein. Man sollte bei Backup/Restore alles verstehen. Folgenden Fehler hast du scheinbar nicht verstanden. Der Begriff “pigz” kommt sehr oft vor. Backup/Restore kann meiner Meinung nach gar nicht funktioniert haben. 100% sicher bin ich mir aber nicht.

/bin/sh: 1: pigz: not found
tar (child): pigz: Cannot exec: No such file or directory

Installiere mal das Paket “pigz”.

(sudo) apt-get install pigz

Debian -- Package Search Results -- pigz
Ubuntu – Package Search Results -- pigz

Und versuche alles zu verstehen.
Ich gebe dir einen Tipp. Schreib dir eine eigene Restore/Backup-Routine.
Das ĂŒbt.

Sicher? Eigentlich hat das Komprimieren und Entpacken nicht funktioniert. Ich bin mir aber nicht zu 100% sicher. UnabhÀngig davon solltest du aus deiner Backup/Restore alle Fehler und Warnungen entfernen.

Hallo devnull,

vielen Dank! Das mit pigz hatte ich auch gesehen und dann auch gleich installiert. Aber auch danach sind die weiteren Fehlermeldungen geblieben. Ich hatte zudem noch einen Fehler beim Anpassen des Skripts ĂŒbersehen, den ich auch gleich korrigiert habe. Letzlich schlud das Restore trotzdem noch fehl. Es blieb der mysqldump: Error: ‘Access denied; you need (at least one of) the PROCESS privilege(s) for this operation’ when trying to dump tablespaces. Erts die ErgĂ€nzung mit –no.tablespaces nach mysqldump im Backup-Skript hat sĂ€mtliche Fehler bereinigt. Jetzt lĂ€uft sowohl Backup als auch Restore ohne Fehler durch!

Warum die Testdaten trotzdem wieder da waren, kann ich mir aber auch nicht erklÀren :wink:

ich habe nun noch mal alles wiederholt und nun funktioniert es nicht mehr. Das Backup Script lĂ€uft ohne Probleme durch aber der Restore klappt leider nicht mehr
 Der Fehler ist mir nicht klar
 Ich habe alle Schritte exakt gleich aufgebaut, aber der Fehler hat sich wohl schon nach dem ersten “erfolgreichen” Restore eingeschlichen. Ich konnte auch keine Dateien mehr ablegen – hatte das aber erst misachtet, da ich eh eine Testinstanz fĂŒr die Implementierung der Backup-Routine nutze
 Ich bekomme nun folgende Fehlermeldung und die Nextcloud ist down:

Your data directory is invalid
Ensure there is a file called “.ocdata” in the root of the data directory.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:162
Stack trace:
#0 /var/www/nextcloud/console.php(98): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(11): require_once(‘/var/www/nextcl
’)
#2 {main}Done

Hat jemand eine Ahnung was da nicht stimmt?