Nextcloud update (and restore) failed after first updating yunohost

decompress it

gunzip -c /home/yunohost.backup/archives/nextcloud-pre-upgrade2.tar.gz > /home/yunohost.backup/archives/nc_bak2.tar # nc_bak2.tar  or whatevcer you want

Thanks, I decompressed it with gunzip -c, did tar --update -f nc_bak2.tar apps/nextcloud/settings/scripts/restore, then ran yunohost backup restore nc_bak2 --debug

but the operation failed, see logs: https://paste.yunohost.org/raw/odadunaqeb

Check if your nextcloud database was totally removed :

 mysql -u root
# mysql  shell
SHOW DATABASES;

Thanks, that was the issue! I dropped the database, ran the restore script, and everything works fine now. Thank you very much for your help today <3

2 Likes

:champagne: !!!

2 Likes

I tried this this morning, and restoring the backup failed in the same way it did for apt9637. https://paste.yunohost.org/raw/ohugofezab

root:~# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 37
Server version: 10.11.14-MariaDB-0+deb12u2 Debian 12

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+

any idea where this goes wrong?

In this case, I’d comment out this line in the (copy of) archive restore script

chown -R $app: "$data_dir"

In most of the cases this can be skipped.
Is it a huge nextcloud data directiry ? Its permissions and ownership should alerady be the good ones. drwxr-x--- (...) nextcloud nextcloud

sorry, I think I did not execute correctly. I had updated my reply, but I’ll keep commenting out the chown command if that ever comes up again!

Now I’m stuck on the same issue as apt9637 had, but I don’t seem to have a nextcloud db remnant…

We’re going in circles :smiley: It’s hard to know the causes of the upgrade crash… since the logs are no longer supposed to be displayed

Haha, yeah we are. Sorry for that, and all this. You’ve been amazing.

when I tried to update the tar with the restore script like this:

tar --update -f  nc_bak2.tar apps/nextcloud/settings/scripts/restore

and I then checked the contents of the tar via

tar -tvf file.tar

Then the tar ended up with two restore scripts:

Also, I tried it the last time via the webUI. Could it have not worked before because the restore command gets aborted (?) if the CLI loses connection with the server?

The restore script finished successfully, but then the update script had errors. Which lead me to believe that this is not sustainable. So I’d rather cut my losses and get rid of the planet geometry table..

This has been pretty upsetting and demoralizing, because if anything, restoring a backup should be super dependable. But that’s a different topic. Thanks so much otm33, wishing you all the best!!

1 Like

…two, three, four… I know, it’s weird :smiley:

1 Like