did not restore data dir and database dir on USB drive when installing NCP on new SD card

My SD card got corrupted and I installed ncp fresh from the image to a new card. My database and data dir are on a USB drive.

I started the setup, but didn’t use the ncp setup wizard. Instead I

  1. enabled ssh
  2. enabled USB auto mount
  3. updated NCP (my image was not current)
  4. used ncp-config to run the NCP config import (ncp-config_ xxx.tar) to restore the ncp configuration
  5. updated NC because also this was not the current and less than the version before the crash. (I was lucky and had a DB backup as my first try messed up my DB as a NC 24.x was trying to “upgrade” from a v25.0 database …)

However, I noticed that both the directory of the database and the NC data directory was still at the default location and not on my USB drive.

Shouldn’t these settings be also restored?

Or is there a better / recommended way to replace a broken SD card?

In fact, I looked at the sources of and and (hopefully) have manually executed all the steps from there.

(And the first time I did this I made the mistake and accidentally upgraded php to 8.2 and I had to do the same procedure again … as I wasn’t able to fix all issues.)

NCP v1.51.0
Nextcloud version:
Operating system and version: Raspberry with Debian GNU/Linux 11 (bullseye)
Apache version: 2.4.54
PHP version: 8.1

No. This isn’t in scope of nc-import-ncp.
Nextcloud directory configuration is part of nc-restore (part of nextcloud itself).

FYI: For more information regarding a full restore please read

Not that i am aware of. It’s somehow specific. NextcloudPi documentation doesn’t cover that, so you have to dig into the details on your own.
→ And you made it! Congratulations!

1 Like

Thanks!! I guess I’ll improve documentation as soon as I have some free time …! :star_struck:

1 Like