Migrate bare metal to All-in-One (same server/same data directory)

I would like to switch from my bare metal install to All-in-One instead. This is on the same server (Ubuntu 24.04.03 LTS). I have read this guide: all-in-one/migration.md at main · nextcloud/all-in-one · GitHub

I’m completely lost on how to navigate from step #5 and #6. It seems to be written for a reader who wants to move the data to a new location. But what if I don’t want to move it?

  1. Restore the datadirectory of your former instance: for /path/to/old/nextcloud/data/ run sudo docker cp --follow-link /path/to/old/nextcloud/data/. nextcloud-aio-nextcloud:/mnt/ncdata/ Note: the /. and / at the end are necessary.
  2. Next, run sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chown -R 33:0 /mnt/ncdata/ and sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chmod -R 750 /mnt/ncdata/ to apply the correct permissions. (Or if NEXTCLOUD_DATADIR was provided, apply chown -R 33:0 and chmod -R 750 to the chosen path.)

If my data directory is: /mnt/4TB01/Nextcloud/data, is there any way I can just re-use this as-is?

Step 8 sounds hopeful:

  1. Run sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan-app-data && sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all in order to scan all files in the datadirectory.

I guess I’m hoping for something even simpler than the supposed simplest migration option which is “migrate the files only”. As in, just point AIO at the existing data directory.

Am I way out in space in here? Any guidance will be appreciated. I did scour the internet and these forums but I seem to be on a special newbie island.

PS. I’d gladly take tips for whether to run docker compose as a systemd unit/service, that runs as a lesser user than root (e.g., in the Unit file: user=nextcloud and group=nextcloud. I’m struggling to determine if this is what running containers “rootless” means.

In the end I put my compose.yaml into /srv/nextcloud-aio and I just followed the migration guide exactly. It worked perfectly. I just renamed my original data directory to data_orig and then let the commands do their thing. Will soon delete data_orig since the borg backups are now running and all clients/data verified.

2 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.