[solved] Need a How-To: Rescue data when upgrade & backup is broken

Hi!

Background:

  • A working Nextcloud 13.0.3.2 (encrypted files)

Activity:

  • Wanted to upgrade to 14.0.0.3

Outcome:

  • Upgrade is totally stuck at “searching for an update for the app “activity” in the App Store” & none of the found solutions (occ commands) works
  • When trying to reactivate backup it says “Need to upgrade to 13.0.3” and gets totally stuck at “Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing ‘SELECT class FROM oc_admin_settings WHERE class = ? LIMIT 1’ with params [“OCA\FederatedFileSharing\Settings\Admin”]: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘DB3308447.oc_admin_settings’ doesn’t exist”

So … now I have no working instance - and no data … any ideas how to solve this?

Rufio

The downgrade most likely fails because the database is already (partially) updates.

You could try to do an upgrade manually by downloading the 14.0.0.3 zip and extract it to the webroot of nextcloud. Afterwards call “php occ upgrade” as www-data user inside the webroot directory.

I hope that helps to recover your installation.

Well … I forgot to mention that the Webupdater not worked for me.
The stuck at “search Activity-App-Update” upgrade is a manual upgrade.

And by “none of the found solutions (occ commands) works” I meant … not even “./occ upgrade” helps (got a weird errormessage I forgot to save)!

So - there I am still without any working instance or my data.

Rufio

How did you create the backup? Usually, a full backup also contains a database dump.

Sorry, i did not get that you already tried that.

I see no way that you can get the downgraded version working.

The table oc_admin_settings has already been droped by the updater while running this migration script:

The only way is to try to opgrade to 14.0.0.3 again and get this version running. Mabe you can try again and give us a detailed log and the error message you got.

Furthermore please run the following select:
Select * from occ_migrations

With this output we can see if the database has been entirely upgraded.

A database backup might be helping you, normally the updater app should do a backup as well, check the data-folder if there is something from the updater.

Regarding a missing table, I found two other topics with similar messages but different table names.

Sorry on coming back that late … had a lot to do (and to rescue my data)!

I’ll just don’t like to leave a question open - so I’ll close it here with following experience and result:

My last planned intention before your question on the database (Select * from occ_migrations) was a clean installation. So I deleted all data from webspace, installed 14.0.3 up to the point where to create accounts, interrupted the routine and simply uploaded the backup.
Works predominantly

  • nearly all data is back
  • up to 90% of nextcloud functions are up and working
  • lost nearly all avatars (been able to get 2 back, none of the other accounts accepts upload or else … gives me an endless hourglass)
  • one client (andoidapp) can’t downoad, it always says maintenance mode is active
  • looks like nextcloud doesn’t read the adjusted .htaccess (regarding caldav path)
  • and some other very small problems are mentioned on the settings page which have been corrected in earlier versions and it seems I can’t correct them any longer or nextcloud doesn’t see it.

After all the lessons learned:

  • webupdater produces some similar core problems over all these years and no one changes the code … so I’ll never try this again
  • I’ll reduce the addons dramatically => because of name changes and/or compatibility issues I’ve lost half of them (with data left unreadable), and it is a well known problem (updatecheck of addons before upgrading nextcloud is discussed often) but no one changes the code
  • when the next upgrade comes I’ll decrypt all data first and make the backup afterwards

So, when having a few days off I’ll kill and delete all nextcloud-apps & the cloud itself traceless and will try to set up a new one … maybe.

Rufio

PS:
DecaTec … I’ve had two backups;

  • a 1:1 copy (sftp) from webspace (before upgrade failed)
  • the backup nextcloud makes by itself
    = none of them worked!

Actually, it is the webserver and it can be set up that you are only allow to change certain parameters.

After the split up with ownCloud, the webupdater was rewritten and has improved a lot. There are some limitations on scripts that run via web (mostly runtime and memory limits) but also the environment. It would be great if we could detect such problems before. In general it is better when you can run upgrade from command line.

Actually, it is the webserver and it can be set up that you are only allow to change certain parameters.

Well - looks like it was only a bit slow … the “error message” on settings page is gone!

So the only “big” problems which are left;

  • not able to download, and not ionly 1 app … all apps say the cloud is in maintenance mode ;-(
  • no avatars on some accounts

Rufio