Change datadir to my home directory of my nextcloud docker aio

Good day.
I’m trying to change my nextcloud docker datadir to the directory /home/waleed/nextcloud_docker so I used the command below but it doesn’t seem to store data there. I followed the wiki and saw one post regarding the same but still I’m note able to do it. Am I missing something in the command?

Appreciate your assist.

sudo docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 8080:8080 \
--env APACHE_PORT=11000 \
--env APACHE_IP_BINDING=127.0.0.1 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--env NEXTCLOUD_DATADIR="/home/waleed/nextcloud_docker" \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest

Hi, did you already enter your domain in the AIO interface and started the installation?

Yes done.

I also removed the master container and tried it in another way:

rsync -av /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/ /home/waleed/nextcloud_docker/
sudo docker run \
    --init \
    --sig-proxy=false \
    --name nextcloud-aio-mastercontainer \
    --restart always \
    --publish 8080:8080 \
    --env APACHE_PORT=11000 \
    --env APACHE_IP_BINDING=127.0.0.1 \
    --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
    --volume /var/run/docker.sock:/var/run/docker.sock:ro \
    --volume /home/waleed/nextcloud_docker:/mnt/ncdata \
    --env NEXTCLOUD_DATADIR="/mnt/ncdata" \
    nextcloud/all-in-one:latest

Ah I think possinly your user simply cannot see the files then. Can you show the output of

sudo ls -la /home/waleed/nextcloud_docker

Hi szaimen.
Sure.

root@waleed-dellsysteminspironn411z:~# ls -la /home/waleed/nextcloud_docker
total 28
drwxr-x---  6 www-data root     4096 أغس 28 07:15 .
drwxr-xr-x 30 waleed   waleed   4096 سبت  1 08:09 ..
drwxr-xr-x  5 www-data www-data 4096 أغس 27 00:11 admin
drwxr-xr-x 12 www-data www-data 4096 أغس 27 20:18 appdata_oczr3zkqjgrm
-rw-r--r--  1 www-data www-data    0 أغس 26 23:39 audit.log
drwxr-xr-x  2 www-data www-data 4096 أغس 26 23:40 files_external
-rw-r--r--  1 www-data www-data  542 أغس 26 23:39 .htaccess
-rw-r--r--  1 www-data www-data    0 أغس 26 23:39 index.html
-rw-r--r--  1 www-data www-data    0 أغس 26 23:39 nextcloud.log
-rw-r--r--  1 www-data www-data    0 أغس 26 23:39 .ocdata
drwxr-xr-x  5 www-data www-data 4096 أغس 28 09:04 Waleed

So as you can see the files are actually written to the initially chosen directory

This was the rsync I’ve done when I realised it wasn’t working.

I stopped all the containers, removed the master and did the rsync.

When I ran the container again, still new files not reflecting in the directory.

rsync -av /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/ /home/waleed/nextcloud_docker/

Did you already restarted the containers from the AIO interface?

Apologies for the late response @szaimen

It’s working now but I had to follow the reset in the “link How to properly reset the instance?”
https://github.com/nextcloud/all-in-one

After that I used the command below:

sudo docker run \
     --init \
     --sig-proxy=false \
     --name nextcloud-aio-mastercontainer \
     --restart always \
     --publish 8080:8080 \
     --env APACHE_PORT=11000 \
     --env APACHE_IP_BINDING=127.0.0.1 \
     --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
     --volume /var/run/docker.sock:/var/run/docker.sock:ro \
     --env NEXTCLOUD_DATADIR="/home/waleed/nextcloud_docker" \
     nextcloud/all-in-one:latest

Starting from scratch was easier than troubleshooting :rofl:

Thanks @szaimen for the support.