Moving docker install to new hard drive

Is there a method to move a whole nextcloudpi docker container install to a new drive?

I have tried copying the whole of old drive to the new drive, and restarting the container with it pointing at the new drive, but the web interface is hangs at ā€˜Initializing NextCloudPi for the first timeā€™

define that. please.

whole docker == docker-compose file + docker volumes with your nc data/config

you make a backup of your ā€œnc data/configā€-docker volumes. run the docker-compose file (creation of the container) and put the data in the new volumes. in the docker compose file the volumes are defined.

ok?

On the drive I have these folders

bin database etc ncp nextcloud

So create a new nextcloudpi container on the new drive, and then transfer some or all folders across?

I use openmediavault to run docker and it has a GUI, which is good for a newbie like me to get things going, but makes it harder to learn the details.

did you replace the drive in your server or do you want to add a new drive?

Added a new drive, planning to remove the old one when done

somewhere you should find the volumes used by your containers. (nextcloud and nextclouddb.)
one possible way:

docker ps
docker inspect <nextcloud>
docker inspecht <nextclouddb>

<nextcloud(db)> is the name or id of your containers.
may be openmediafault has a web gui to show you this info too.

stop and remove both container.
mount your new disk.
create directories according to the needed volumes.
copy/rsync on the host all files from the old volume directories to the new disk.
recreate the container but this time with the path to new volumes.

no warrant. :wink: if you have important data sync them to a client and make a backup there too.

Thats pretty much what I did initially, but it got stuck on ā€˜Initializing NextCloudPi for the first timeā€™ when I tried to access through the browser.

Iā€™m wondering if there is something going on in the background and maybe I need to leave it for a day or two and see if it works itself out.

Is this a typo, or a nickname people have given omv to say its unreliable? :joy:

you shouldnā€™t see this. because itā€™s not the first run.

e.g.:

if you start the container a skript checks if there is a config.php. if not it initializes nextcloud. (creates admin user and so on.)

if you copy all the volumes, you copy also your config.php and this step is skipped.

that assumes that your finished the initial setup once.

Thanks for your help

below is the content of the 2 drives (Nextcloud is the old, NCP is the new)

root@NAS:~# ls /sharedfolders/Nextcloud/nextcloud/config/
config.php config.sample.php

root@NAS:~# ls /sharedfolders/NCP/nextcloud/config/
config.php config.sample.php

As I write this I am thinking that it may be a permissions issue, as I did the copy using root but the container (maybe wrongly) has the PUID and PGID set to my user.

Re-did the copy but this time preserving the permissions and it worked first time.

So in the end it was just a case of copying the files over (keeping permissions), and then relaunching the docker pointed to the new location

Bhahaha! Thatā€™s funny indeed. However, I have been used OMV for years, and it is far from unreliable. Generally the hardware itself fails more often than the software.