[Nextcloud] Disk space issue during upgrade, Nextcloud removed. Can I reinstall and get data back?

What app is this about, and its version: Nextcloud 33.0.3~ynh1
What YunoHost version are you running: 12.1.40.1
What type of hardware are you using: Raspberry Pi 3, 4+

Describe your issue

Hello everyone,

I attempted to upgrade Nextcloud from 33.0.3~ynh1 to 33.0.4~ynh1 today but it looks like I ran out of disk space during the upgrade so that step failed. Yunohost then tried to reinstall the previous version from its backup but that failed too (because of the disk space issue).

My system now does not have Nextcloud anymore but it looks like its associated data is still there (under /home/yunohost.app/nextcloud). My issue is that I had planned on taking a full backup after the app upgrade; I can still do that but since Nextcloud is no more installed, the backup skips the Nextcloud data files. I have a backup available but it’s 15days old and I would like to get the app back up and running if possible first.

Could you tell me if, once the disk space issue is solved[1] I can safely reinstall Nextcloud (from its pre-upgrade backup) and it will use the existing data ?

Thanks for your help and for allowing a hassle-free hosting of apps !

Vincent

[1] My root FS lives on a 10 GiB partition of an external disk (/home is also there but on a much larger partition) and this is surely where the problem comes from. I am using ncdu to find some space to free up (looks like I have several old versions of node lying around, advice welcome for what to remove w/o issues).

Share relevant logs or error messages

It seems much safer to me to back up the data first but, normally, yes, it will. Once restored, you also may have to run

yunohost app shell nextcloud 
php occ maintenance:repair

Hi @otm33 and thanks for your fast reply :folded_hands:

When you say:

It seems much safer to me to back up the data first

do you mean there is a way to still perform a data backup from within Yunohost or are you referring to backup up /home/yunohost.app/via a filesystem copy/backup ?

Data-wise in Nextcloud, I am interested in all the user files as well as the contacts and agendas. Is there a way to backup those in one swoop?

Thanks again for your support !

Restoring from pre-upgrade should be enough to get to where it was before the upgrade.
You can run yunohost tools basic-space-cleanup to make more space. You will need a little more than the double size of the pre-upgrade backup of free space to restore.
Check which node version you are using
grep -r "node" /etc/yunohost/apps/*/settings.yml
Delete the unused versions