Replace data hard disk


i’m running NextCloudPi version v1.16.5 on raspi 4.

I would like to replace my dataharddrive. how should I proceed if I want to have the data on the new disk? ncp is on the sd card.

thank you

Get a USB-SD card adapter.
Boot from the old disk, and export your database to a text file somewhere on that old disk.
Boot from the new disk. Mount the old SD card. Recursively copy the Nextcloud data directory. Then import the exported database file.

(Side note: if you were running UBOS on your Pi, or used a UBOSbox, your process would be something like: one command while booting from the old disk (e.g. offsite backup) and another from the new disk (restore) and you’d be done :slight_smile: Disclaimer: both are my projects.)

Then I expressed myself wrong.

The database should remain on the SD card. The SD card is not replaced.

I just want to move my data to a new larger hard drive (from the existing old hard drive to a new one). So how can I just move the data? Is there a simple detailed instructions?

You can connect both drives (old and new) to a (Linux) PC or laptop and use rsync to copy all the files. Then set config.php datatdir to new drive and run nc-scan.

Or make a fresh install and use NC client to upload the files to new install.

Or simply stop nextlcoud copy data, start nextcloud:

Be careful with this

it will cause Files amount after moving of data directory is wrong (much bigger) and bigger DB.

There is a big topic to read how to do it with all answers: HowTo: Change / Move data directory after installation

@gas85 Thanks, wasn’t aware of that.

@mase Also ncp’s nc-datadir (ncp-config or ncp-web) can be used to move datadir

1 Like

I also wasn’t…