Restoring NextCloud

Hi Guys,
I am (still) stuck ad restoring Nexcloud on my yunohost instance, the restoring fails at this step :
Do not use ynh_install_php to install php7.3
here are a few info :

:uk:/:us: Message template (english)

My YunoHost server

Hardware: Old laptop or computer (Macbook Air 2015)
YunoHost version: 4.0.2~beta (testing) / debian 10.4
I have access to my server : Through SSH & through the webadmin & direct access via keyboard / screen
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain:
Docker installed with some home automation apps (Home assistant, deconz, node red)
fresh install of yunohost 4 on which I restored all apps & config (except Nextcloud that failed)

Description of my issue

I am trying to get back my nextcloud instance with all settings to avoid having to re-pair everything and loose data (120 GB of data + contact + calendar + task)

I have tried through the web interface backup backing up a 600 MB archive (core w/o data)
My data is on an external HDD

the weblogs are (in French :fr:) :

Rien n’a Ă©tĂ© restaurĂ©
Removing the dedicated system user

‘/etc/cron.d/nextcloud’ wasn’t deleted because it doesn’t exist.
‘/etc/fail2ban/filter.d/nextcloud.conf’ wasn’t deleted because it doesn’t exist.
‘/etc/fail2ban/jail.d/nextcloud.conf’ wasn’t deleted because it doesn’t exist.
Removing fail2ban configuration

Removing logrotate configuration

Removing php-fpm configuration

Removing nginx web server configuration

Removing app main directory

Removing the MySQL database

Removing dependencies

Loading installation settings

L’opĂ©ration ‘Restaurer ‘nextcloud’ depuis une sauvegarde’ a Ă©chouĂ© ! Pour obtenir de l’aide, merci de partager le journal de l’opĂ©ration en cliquant ici
Impossible de restaurer l’application ‘nextcloud’
Do not use ynh_install_php to install php7.3
Created symlink /etc/systemd/system/multi-user.target.wants/atd.service → /lib/systemd/system/atd.service.
Reinstalling dependencies

Recreating the dedicated system user

Restoring the MySQL database

Restoring the app main directory

Validating restoration parameters

Loading settings

/tmp/restoreo2jMLG/restore: line 11: _ynh_add_fpm_config: No such file or directory
Restauration de l’application nextcloud 

PrĂ©paration de l’archive pour restauration 

Avoid saying that it “doesn’t work” or that it “does nothing” 
 explain what really happens and how you interpret it !
NB: you can use paste.yunohost.org to share logs and error messages. You can also directly include error messages using backticks like this :

I have included the yunopaste report link

I understand this failure is linked to the php version to be used but do not know how to fix it, any insight ?
Many thanks

Merp it’s not 100% clear to me if that’s a bug in yunohost of if you should have upgraded nextcloud before creating the backup 


If you’re comfortable with tweaking source code, I think you could try to hack the whole thing by :

  • editing the php helper file with : nano /usr/share/yunohost/helpers/php
  • look for the piece of code that looks like :
    if [ "$phpversion" == "$YNH_DEFAULT_PHP_VERSION" ]
    then
        ynh_die "Do not use ynh_install_php to install php$YNH_DEFAULT_PHP_VERSION"
    fi
  • Edit it such that it looks like :
    if [ "$phpversion" == "$YNH_DEFAULT_PHP_VERSION" ]
    then
        ynh_add_app_dependencies --package="$package"
        return
    fi
  • attempt to restore nextcloud
  • undo your changes in /usr/share/yunohost/helpers/php

Thanks for your answer.
For the very beginners, the file is actually /usr/share/yunohost/helpers.d/php
and it did seems to work !! Awesome.
Now nextclout is not available error message saying

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

I will try to find information of that on my side since it may not be related to YNH

Anyway great support as always and great new release with 4.0 ! I have spend time learning about docker to setup my home automation system in February all because 3.6 is based on debian 9 which did not support the required version of python for Home Assistant and it seems that with a couple of month of waiting it would have been solved all by itself !

It was worth learning though

hum I got all exited but I made a mistake after restoring (part of) nextcloud I tried to update the app, and it did not succeed deleting my previous archive and removing the app.

This was not expected, the backup was also removed.
I will try to see if I can restore the newly created bqckup that replaced the former one ^^’

Back on Tracks ! Thanks a lot !

1 Like

Thanks for the information sharing FE

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