Problème à la restauration de ma sauvegarde (nextcloud - il manque un fichier config.php)

Mon serveur YunoHost

Matériel: VPS kimsuffi

Version de YunoHost: 4.2.6.1
J’ai accès à mon serveur : En SSH

Situtation : j’ai installé Yunohost, fait la post-installation minimal et je tente de restaurer la sauvegarde de mon ancienne installation.

Description du problème

Après avoir fait yunohost postinstall (j’ai fait la post-install car yunohost me disait qu’il faut un nom de domaine pour pouvoir restaurer mon archive).

J’ai mis l’archive du backup de mon ancien serveur à l’endroit indiqué dans la documentation.

Je lance:

root@*****:~# yunohost backup restore 20210131-221036
Warning: YunoHost is already installed
Do you really want to restore an already installed system? [y/N]: y

Mais ça fail (extraits choisis):

Warning: chmod: cannot access '/var/www/nextcloud/config/config.php': No such file or directory
Error: Could not restore nextcloud: An error occured inside the app restore script
Info: The operation 'Restore 'nextcloud' from a backup archive' could not be completed. 

Puis:

Info: DEBUG - + chown -R nextcloud: /var/www/nextcloud /home/yunohost.app/nextcloud/data
Info: DEBUG - + chmod 640 /var/www/nextcloud/config/config.php
Info: WARNING - chmod: cannot access '/var/www/nextcloud/config/config.php': No such file or directory

(donc effectivement le script essaie de chmod un fichier qui ne semble pas exister, et je me demand si ce n’est pas parce qu’il a changé de dossier en fait).

Ce que j’aimerais c’est pouvoir me débloquer, et pour ça je suis prêt à aller toucher le script de restore, mais je ne sais pas trop bien comment faire ça.
Quelqu’un peut m’aider ?

Voici le log complet:

Info: Preparing archive for restoration...
Info: Restoring nextcloud...
Info: Running migration 0019_extend_permissions_features...
Info: [....................] > Loading settings...
Info: [+...................] > Validating restoration parameters...
Info: [#...................] > Restoring the app main directory...
Info: [#++.................] > Restoring the MySQL database...
Info: [###.................] > Recreating the dedicated system user...
Info: [###+++..............] > Reinstalling dependencies...
Warning: Load smb config files from /etc/samba/smb.conf
Warning: Loaded services file OK.
Warning: Server role: ROLE_STANDALONE
Info: [######++++++++++....] > Reconfiguring PHP-FPM...
Info: [################+...] > Restoring data directory...
Warning: chmod: cannot access '/var/www/nextcloud/config/config.php': No such file or directory
Error: Could not restore nextcloud: An error occured inside the app restore script
Info: The operation 'Restore 'nextcloud' from a backup archive' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20210711-142507-backup_restore_app-nextcloud' to get help
Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/20210131-221036
Info: DEBUG - + mv /home/yunohost.backup/tmp/20210131-221036/apps/nextcloud/backup/etc/logrotate.d/nextcloud /etc/logrotate.d/nextcloud
Info: DEBUG - + echo '[################+...] > Restoring data directory...'
Info: INFO - [################+...] > Restoring data directory...
Info: DEBUG - + datadir=/home/yunohost.app/nextcloud/data
Info: DEBUG - + ynh_restore_file --origin_path=/home/yunohost.app/nextcloud/data --not_mandatory
Info: DEBUG - + origin_path=/home/yunohost.app/nextcloud/data
Info: DEBUG - + dest_path=/home/yunohost.app/nextcloud/data
Info: DEBUG - + not_mandatory=1
Info: DEBUG - + local archive_path=/home/yunohost.backup/tmp/20210131-221036/apps/nextcloud/backup/home/yunohost.app/nextcloud/data
Info: DEBUG - + '[' '!' -d /home/yunohost.backup/tmp/20210131-221036/apps/nextcloud/backup/home/yunohost.app/nextcloud/data ']'
Info: DEBUG - + [[ -e /home/yunohost.app/nextcloud/data ]]
Info: DEBUG - ++ dirname /home/yunohost.app/nextcloud/data
Info: DEBUG - + mkdir --parents /home/yunohost.app/nextcloud
Info: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/20210131-221036
Info: DEBUG - + mv /home/yunohost.backup/tmp/20210131-221036/apps/nextcloud/backup/home/yunohost.app/nextcloud/data /home/yunohost.app/nextcloud/data
Info: DEBUG - + mkdir -p /home/yunohost.app/nextcloud/data
Info: DEBUG - + chown -R nextcloud: /var/www/nextcloud /home/yunohost.app/nextcloud/data
Info: DEBUG - + chmod 640 /var/www/nextcloud/config/config.php
Info: WARNING - chmod: cannot access '/var/www/nextcloud/config/config.php': No such file or directory
Info: DEBUG - + ynh_exit_properly
Info: [....................] > Loading installation settings...
Info: [++++++++++..........] > Removing dependencies...
Info: [##########++........] > Removing the MySQL database...
Info: [############+.......] > Removing app main directory...
Info: [#############+......] > Removing NGINX web server configuration...
Info: [##############+.....] > Removing PHP-FPM configuration...
Info: [###############.....] > Removing logrotate configuration...
Info: [###############++++.] > Removing Fail2ban configuration...
Info: '/etc/fail2ban/jail.d/nextcloud.conf' wasn't deleted because it doesn't exist.
Info: '/etc/fail2ban/filter.d/nextcloud.conf' wasn't deleted because it doesn't exist.
Info: [###################.] > Removing the dedicated system user...
Info: [####################] > Removal of nextcloud completed
Error: The operation 'Restore 'nextcloud' from a backup archive' could not be completed. Please shar
e_app-nextcloud' to get help
Error: Nothing was restored

vu que

# tar tzf 20210131-221036.tar.gz|grep config
apps/nextcloud/backup/var/www/nextcloud/config/
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20210117.083512
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20200806.225035
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20200519.105021
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20200817.112318
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20200807.005814
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20191121.084824
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20201027.085936
apps/nextcloud/backup/var/www/nextcloud/config/config.php.backup.20200125.131811

je vais tenter de refaire l’archive en ajoutant config.php.backup.20210117.083512 comme config.php

Bon ben ça a fonctionné on dirait ! Youpi :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.