Backup and Restore Nextcloud on UCS


I try my first steps with nextcloud on UCS. Using without backup is bullshit.
My first attempt in backup and restore failed. What was my way?

The Core of backup
-> directory: tar -vcpzf ZIEL QUELLE
-> database: sudo -i -u postgres pg_dump -v -Fd nextcloud -f ZIEL

The Core of restore:
Restore Data-Directory
-> Delete the directory: cd /var/lib/univention-appcenter/apps/nextcloud rm -r -f data mkdir data
-> extract the backup: tar -vxpzf /BACKUP0/NEXTCLOUD/SAVE_YYYYMMTT/DATA_YYYYMMTT_HHMMSS/nexdata.tar.gz -C /
Restore database
-> delete database: sudo -i -u postgres dropdb nextcloud
-> restore from dump: sudo -i -u postgres pg_restore --format=d /BACKUP0/NEXTCLOUD/SAVE_YYYYMMTT/BASE_YYYYMMTT_HHMMSS
Set fingerprint
univention-app shell nextcloud sudo -u www-data php /var/www/html/occ maintenance:data-fingerprint

Whats wrong?

What exaclty did fail?
Where is the output after execution od each step?

I have problems with the restore of a directory to the database with pg_restore.
After the described restore nextcloud didn’t start.
I decided to install the whole server again.
Now nextcloud is working on the new installation.
Next time I want to restore on a new installation in a better way.
Thats the reason I ask for the right way to backup an nextcloud-installation on UCS.

Take a look to Nextcloud - guide:

The nextcloud db-password can be found with the Nextcloud docker:

univention-app shell nextcloud
less var/www/html/config/config.php

If your UCS-server is running in a VM, create a snapshot before testing. So you will be able to restore the snapshot, if your tests fail.

Thank you very much for your fast feedback.
In 2020 my work and my familiy cost a lot of power.
So I will save your hints and try in a few weeks.