Need Advice on NextcloudPi

Looking for some advice. I installed NextcloudPi on my RPi3, and moved my Database, data directory, and Swap file to my external USB drive.

I’ve now found that the External drive powers down after a period of inactivity. I just ordered a WD Red NAS drive to replace the existing external drive. Once it comes in, I’ll need to replace the existing external HD with the new Red Drive.

Here is my question, Can I move my swap back to the USB stick I boot from, and then use the NCBackup utility to backup my existing Database and Data directories and then restore them once I’ve replaced the external drive? Or should I move the Database, Data directory, and swap file BACK to the USB stick and then replace the external drive?

I don’t have any data on the external drive yet, just the 4 user accounts I’ve created.

Thanks for the advice.

1 Like

You should backup with nc-backup in any case, this way you will be able to restore if anything goes wrong.

But if you moved your database and datadir, nc-backup will not prevent the database from failing because it will still try to find the database in the external drive. nc-backup stores a copy of the database, but will not change where its located.

You can

  • use nextcloudpi-config to move your swap back to the SD, /var/swap for instance
  • same thing with database and datadir ( /var/lib/mysql and /var/www/nextcloud/data1 )
    and nc-backup to save your instance to a file.
  • replace hard drive
  • move everything again

Another option is to plug both drives in, stop the webserver and database, and copy both folders keeping permissions, then bring the servers back up. I only recommend this if you are familar with managing services and permissions in Linux.

After you rep

Thanks nacho! That’s what I thought. The new HD I bought is always on, with no power down. So that should solve the problem once I replace the old one and move the data back to the new one.

Update, Got my new HD today and install it. Moved everything around an all is good

It’s a WD red drive so its always on. Will see how that works in a few days.

awesome, let us know

mine is also always on and no problem in years

So… It happened again today. Rebooted the Pi and all is well. I moved the database BACK to the USB stick that I boot from. Hopefully, that will work. We shall see.

What power supply are you using? are you powering the HDD through the Pi?

Like I said… I have had this setup for years, since the days of RPi 1B