How to move storage to another drive with Docker Windows

Sorry if there is an answer to this but all support, I found on this form is geared towards a Linux, I am running NextCloud AIO on Docker within Windows. I am new to this, so I wanted to use an OS I am familiar with

Right now, I have everything running on an SSD but I want to move all the files I am storing on a hard drive. How should I change it so NextCloud would point to the new HDD to store my files? I already have over 100GB of files, and I would prefer not to start this from scratch again.

I found some articles (linked below) but they give commands and examples which appear to be in Linux, but I’m using windows so I have no idea what the equivalent step would be

Question about changing data DIR? · nextcloud/all-in-one · Discussion #890 · GitHub

Change data directory with Docker - :information_source: Support / :package: Appliances (Docker, Snappy, VM, NCP, AIO) - Nextcloud community

Change Nextcloud data folder location - Support - NethServer Community

Hi, this hint also applies to windows: Question about changing data DIR? · nextcloud/all-in-one · Discussion #890 · GitHub

In general this should work:

Another solution would be stopping all containers from the aio interface, creating a backup, removing and recreating the mastercontainer with -e NEXTCLOUD_DATADIR="/run/desktop/mnt/host/c/ncdata" then restore the most recent backup and afterwards starting the containers again from the aio interface. In that case you should then delete the content of /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/ manually since the data would be duplicated otherwise.

However of course you also need to adjust NEXTCLOUD_DATADIR="/run/desktop/mnt/host/c/ncdata" to the value that you want to use. See https://github.com/nextcloud/all-in-one?tab=readme-ov-file#how-to-change-the-default-location-of-nextclouds-datadir

Sorry I am new to this so I may need a step-by-step guide, where would I run the “-e NEXTCLOUD_DATADIR=”/run/desktop/mnt/host/c/ncdata" " command? When i put it in cmd, I get an error saying “‘-e’ is not recognized as an internal or external command, operable program or batch file”

What I have done so far is copy the ncdata folder from my c drive to my new g drive so the new path I would imagine be " “NEXTCLOUD_DATADIR=/run/desktop/mnt/host/g/ncdata”.

I would imagine I would need to remove the master container and create it again but update the path to the f drive from the c drive, but how would I update the path and rebuild the master container? also how would i back up the master container before removing it? Would removing and rebuilding the master container make me lose all my settings?

*edit I forgot I had to download ubuntu LTS on windows to set this up, so I tried that as well and got a similar error, saying “-e: command not found”

*edit 2: I think I finally figured out what I was supposed to do. Took way too long to realize. I made a backup, deleted master container and then ran this command in cmd (don’t forget to add the “^” at the end of your line for the new path. I spent too long trying to figure that out)

**
docker run ^
–init ^
–sig-proxy=false ^
–name nextcloud-aio-mastercontainer ^
–restart always ^
–publish 80:80 ^
–publish 8080:8080 ^
–publish 8443:8443 ^
–volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config ^
–volume //var/run/docker.sock:/var/run/docker.sock:ro ^
-e NEXTCLOUD_DATADIR=“/run/desktop/mnt/host/f/ncdata” ^
nextcloud/all-in-one:latest
**

making sure to add the line you mentioned in the install run command to recreate the master container. It looks like its booting up now I hope this works

*edit 3: everything looks great, thank you for the help.