Can I safely change my database (ncdata) folder to another hdd?

I want to swich my harddrive of my nextcloud server, because Im getting more often S.M.A.R.T. errors. So Im copying at the moment the whole ncdata folder to the new harddrive. I also want to use another raspberry (the new pi 4). I was wondering If someone knows if my plan will work:

  1. making a configuration backup
  2. copy the ncdata (database) folder to the new harddrive
  3. restoring the config backup on the new nextcloud instance (pi 4)
  4. pluging the new harddrive in, changing the data directory to the copied ncdata on the new harddrive

Will it work? its somehow important to not loose the user data…

Would really appreciate to hear your thoughts on it @nachoparker if you got a minute…

Sounds like a good plan. You might want to put the cloud in maintenance mode before, and disable maintenance thereafter.

look in docs.nextcloudpi.com. You probably want to backup - restore from ncp tools