MySQL db lost, recovery on new installation

Hi there,

I’ve a curious situation at hand. Been running Nextcloud for more than a decade on a raspberryPi 2.
I have Nextcloud and it’s data directory on a 4TB external disk.
The OS with MySQL on a SD card.
MySQL data dir on a thumb drive.

Now, I got a new RaspberryPi that I’m installing AND the thumb drive fried last week.

What’s the best course of action considering that the MySQL database is lost and likely I won’t be able to install the same version anyways.

I was thinking the following:

  • I create a new MySQL db on whichever version ships today with Debian
  • I try to make Nextcloud setup the tables and such
  • I use the ‘scan’ (?) occ command to import existing Nextcloud data.

I don’t use any Nextcloud feature other than file storage (no calendars, no documents, …)


Yes starting new and then rescanning the files. Since you don’t have a backup of the database, there is not much more you can restore. In the future, I’d think about a backup of the database, so you want loose the shares and if you reimport everything, you need to resync all the clients…

Not sure if you fancy to move to NextcloudPi or a docker/container-based solution. If you don’t fancy any of their features, you can just run on bare metal.

1 Like