Restore installation after a root broken disk

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).

Hi

I’ve lost my root disk and mariaDB database with the datas of my Nextcloud 34.0.1

I’ve got /var/www/nextcloud direcory in an other disk with no data loss

I want keep all my files without downloading all files again (238Gb)

I’m on Debian 13 (same installation)

Actually I have a road map but I don’t know if it’s a good idea :

- rename /var/www/nextcloud in /var/www/nextcloud-old : done

- make a new data base with MariaDB (done but it’s empty)

- make a new folder /var/www/nextcloud with the ZIP file in version 34.0.1 : done

- run the installation of the new Nextcloud for /var/www/nextcloud (not done, I don’t want to make a mistake)

- put the new Nextcloud in maintenance mode with : sudo -u www-data php /var/www/nextcloud/occ maintenance:mode –on

- move the file of /var/www/nextcloud-old/data in /var/www/nextcloud/data (maybe, all the file of the new installation in the old installation but not files/folder in data folder)

- check the right access of files/folders and owners and groups

- make a scan of all files in data folder with : sudo -u www-data php /var/www/nextcloud/occ files:scan –all

- delete the maintenance mode with sudo -u www-data php /var/www/nextcloud/occ maintenance:mode –off

Thanks for your attention/help/…

The problem is that files are identified on client and server side by a fileid (running index on the filecache table) and an etag (which changes after each modification). This way the client can keep track of the files and which one have been changed or not.

The problem is that you lost the main database, and you cannot recreate the table with the same fileids and etags from before (you might try to do this manually from the sync-table of the client). I would start from a fresh setup, there is too much risk that you introduce some strange bug from the start.

Unfortunately, you cannot tell the client that it should try to match the versions or checksums or something like that and you have to either download everything from the server with the new file-identifications, or upload everything to an empty Nextcloud. If it is a single client, I wouldn’t worry too much and just let it run through all the files, and use the time to think about a backup of Nextcloud.

Thank you for your message
I don’t know how Nextcloud work and you tell me how.
I think I wil try to restore with upload

Well, we all start somewhere and need to learn. Just if you start to use it more seriously, don’t neglect the subject of backups. Just like in your case, that is just annoying but e.g. some apps store information in the database and such things can be lost.