Moving NC to a new machine - advice needed

Hi, everyone. I’ve been using Nextcloud for a few years through Nextcloudpi on an Odroid-HC2, a 32-bit single card computer similar to a RaspberryPi. A year or so ago, after updating Nextcloudpi, Nextcloud, and the underlying Armbian Linux, something broke, and I was no longer able to update to successive versions, but most importantly, I was no longer able to upload or download files bigger than 2GB - all ended up incomplete.

Anyway, I was never able to fix it, and I’m giving up on that device, and plan on moving to a mini PC I picked up, specifically an HP Prodesk 600 G4. It’s too small for my 3.5" drive, so I’ll have to attach the drive as a USB external.

I’m looking for advice on:

  1. Backing up old machine - I have several terabytes of music and movies, and not much else, apart from a few dozen recipes in the Cookbook app, which I could reproduce by hand.

  2. Simplest and most efficient way to set up new machine. I’m far from a Linux expert, but I can brute-force my way through command line. I’ve read and watched a bit about Nextcloud AIO and Docker, and those sound like a good place to start; I’m hoping to end up with a system I can easily update and maintain as a relative novice.

Regarding old system backup, I mainly need the data, and don’t mind having to recreate the few user accounts. Also, I’ve seen recommendations that new and old versions of the system should be on the same versions in order to copy over settings, and that’s never going to happen in this case. Would it be best to simply copy the data to a backup offline, disk-to-disk, or are there database files that would be best to transfer to the new machine as well?

I think that should do for now. I appreciate any advice. Thanks!

If you don’t mind, then use a new name, i.e. cloudnew.server.tld instead of cloudold.server.tld. Then you can run both in parallel without stress.

Then I would install the new Nextcloud from scratch. Think about whether you want to use LAMP as normal or perhaps Snap, AIO, NCP, … . Think about it really carefully.

Then install the latest Nextcloud on the new server. Create a new user or users. Copy the data with e.g. sftp/scp/rsync, … from /path/to/nextcloudold/data/username to /pat/to/nextcloud/data/username . Then run the command that the new Nextcloud knows all files.

sudo -u www-data /path/to/nextcloud/occ files:scan --all

And you’re done for now. Ok you lost everything in apps an shares, … But not the data. You can rename the Nextcloud again and maybe you still need an ssl certificate etc. I have left that out for now.

2 Likes

Regarding AIO, there is this documentation available: all-in-one/migration.md at main · nextcloud/all-in-one · GitHub

2 Likes

Nextcloud snap is designed to be easy to install and simple to maintain. The ideal Nextcloud snap is an “install and forget” Nextcloud instance that works on most architectures and updates itself without needing administrative skills.

example system specs

agreed, this should be the easiest way to get your raw data over to a fresh install! the snap path is different though see Nestcloud snap default path, where is my stuff

also suggest you export your contacts and calendars from the old instance for easy import into the new instance, regardless on installation type

2 Likes

Hello,

Technically speaking, this will work but beware, this is the worst possible way of running a backup server. Slight vibration / jerk or movement, be it intentional or accidental may disconnect the drive in a running system with catastrophic (irrecoverable data loss) result.

If you really have to run it in that way, ensure to put the system in a place which would never see any physical movement of any kind. On / around or near it.

You need to provide more information about this setup to identify the actual user data storage location. Since different deployment methods store user data at different locations.

Different people will have their different opinion about what is easy.

Personally, I vote for Snap Nextcloud

Starting fresh is always a better idea for people like me who aren’t that good with technologies. Since restoration of a broken system may bring in a lot of unwanted junk causing performance issues or security concern.

Now it would depend on your skill set to troubleshoot and take the restoration route or start fresh.

Thanks.

2 Likes

Thanks, everyone - this all sounds like excellent advice, including one good reminder about an external data drive. I might use a different machine that has an eSATA port - still not ideal, but I think it’s a firmer physical connection.

I’m going to look into the Snap installation, because that sounds like just what I’m looking for.

One question regarding restoring my data: can I simply copy my files over to wherever the data directories happen to be on the new machine disk-to-disk by connecting the data drive via SATA, and will the files then be recognized by the Nextcloud instance and indexed or added to the database once the server is started? Or do I have to upload them either through the Nextcloud web interface or by using a desktop client to sync folders?

Thanks again!

Hello,

The later option, although bit tedious but would definitely work without any hitch, when you manually upload the files via nextcloud web or client to individual users.

However, the first option would work too. Just ensure to create the users first (in your new nextcloud installation along with enough disk quota) and then copy or sync respective files for each users into their respective user data directory.

Once the copying is done, run following command to update the file structure into the database,

  • sudo nextcloud.occ files:scan --all
  • sudo nextcloud.occ files:scan-app-data
  • sudo nextcloud.occ files:repair-tree
  • sudo nextcloud.occ files:cleanup

Rewfer here → database‐apps‐files‐maintenance · nextcloud-snap/nextcloud-snap Wiki

@scubamuc and snap team has done a really good job with their WiKi and documentation since most of your questions are already covered in there. Do consider reading the Snap Nextcloud Docs → Home · nextcloud-snap/nextcloud-snap Wiki

Thanks.

1 Like

Perfect, thank you!