Move data from a broken NCP instance to a new one

Hi everyone,

I had a NextCloud running on a Pi 4, but some days ago the Pi had some issues and did not boot anymore. After this I created a backup image of the SD card, but installing this back to the SD card does not work, apparently some important files somewhere are broken. Most files seem to be fine, though, so in case there is something important there it should be possible to recover it. Both ncdata (contains e.g. user directories) and ncdatabase (contains e.g. directories mysql and nextcloud) were on a USB-Stick and were apparently not affected so I copied them to another drive.

I have now installed a new NCP instance on the SD card and the USB stick, which is running without issues.

How can I now transfer user accounts, user data, calendar, etc. to the new NCP instance?


If you have the data of the datafolder (the user files), the database (most app data like calendar etc) and the config file, you should be able to restore it. I don’t use ncp to tell you, in which order you should proceed (e.g. first installing the system and then just plugging in your old data). Important is to use the same NC version.

If you don’t have the config file, it is a bit more difficult, shares and some stuff might not work and passwords probably need to be regenerated. If you have used the updater app, in the data folder, there is a update-randomstring from the updater, where the old config files was backed up.

And before you do anything, make sure you have a copy of everything you have left first, in case some of the restore points don’t work that you won’t destroy the data.

Thanks for the response! I have set up a new instance using the same version (22.2.2), than I copied ncdata, ncdatabase and config.php from the backups to the new positions. I also had to adapt the ownerships, I set them to www-data:www-data for ncdata and config.php and to mysql:mysql for ncdatabase.

It does not work, though. The NCP System info shows error for the entry Nextcloud check. The NextCloud logs are empty. I already tried changing the log-path to /var/www/nextcloud/nextcloud.log, after rebooting the log-files were created but remain empty.

Any further ideas what to do to solve or narrow down the problem? Are there other log-files somewhere else?