Can I restore a backup from NC 20, NCP 1.34 on a brand new install?

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 20 (not 100% sure)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 10 (via nextcloudpi)
  • Web server and version (e.g, Apache 2.4.25):
    • no clue - as installed by nextcloudpi
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • none - local network insallation
  • PHP version (e.g, 8.3):
    • 7.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • updating ncp from web UI
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • ncp
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no (nothing really changed after ncp setup)

Summary of the issue you are facing:

After years of running NC 20, NCP 1.34 on Debian 10 I tried an NCP update via NCP web UI and with that killed the whole thing. I spent the whole day trying to get it to work again, but think it is time to start from scratch.

So my main question: Is it safe to wipe the system and run a fresh deployment, then restore the backup I created with ncp-config on console (while the web frontend wasn’t working anymore)? I also backed up config.php.

Is there anything else I should copy before I try a new install? Is there an easy way to copy the whole microSD as a backup before flashing?

Important data on NC where calendars and contacts for three persons. Anything else (a few files for testing) doesn’t really matter.

In case anyone wants to try end help me save the current setup: I manually updated to Debian 11, ncp 1.55.4, PHP 8.1, manually copied NC 25 into the folder (and added my old config.php), installed loads of PHP modules to remove error messages when trying to install NC I now get:


sudo -u www-data php occ upgrade 

An unhandled exception has been thrown: 

Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:237

That is not possible. If you want to restore the Nextcloud internal information e.g. user, shares, contacts, … you must use the same Nextcloud version.

If this is too much work for you and you want to create the users, shares, … manually again, you can also proceed as follows.

  • install Nextcloud 31
  • create the required users, delete their default files
  • copy the backup files to e.g. /path/to/nextcloud/data/username/files
  • execute sudo -u www-data /path/to/nextcloud/occ files:scan --all that Nextcloud knows the manual copied files

As already mentioned. Only the files are restored. You must set the shares from hand and other parts e.g. contacts, … are also missing.

Either upgrade one major version at the time or start from scratch. That are the options you have.

Yes. NC 20, 21, 22, … , 29, 30, 31

If you start from scratch you should consider to have a backup strategy in place in the future :wink:

Thanks for all your responses - that was really quick!

Unfortunately, I am beyond updating one version after each other – the update I triggered in the web ui for ncp went straight from 1.35 to 1.55 (and failed). After that, I tried to manually update nc to 31, assuming I would still be able to use my backup (I realise now that was a bit naïve…).

I’m really glad to report that I found BernieO/calcardbackup: Bash script to backup calendars and addressbooks from a local ownCloud/Nextcloud installation - Codeberg.org and was able to extract all contacts and calendars from my DB into vcf and ics files. I guess I’ll just set up a fresh install, re-configure it with the same users and re-import the data. I used that same strategy almost 5 years ago when moving from OwnCloud to NC.

If anyone knows how to do the same with user settings etc., that would be awesome, but for 3 users I assume I will survive doing that manually.

I’ll start a separate thread on best update strategy and efforts for that… I definitely don’t want to end up here again. And yes, backups will be a part of that :grimacing: