Data and pins are not shown after docker ipfs restart

I have a go-ipfs docker node running which has a lot of data pinned in it. It was running with auto-gc enabled which was blocking a lot of RPC calls every hour when GC runs. In order to disable auto-gc, I have stopped existing container (docker stop), removed it (docker rm) and started a new container (command given below) by pointing it to same data directory. To my surprise, none of the existing pins and files are shown when i do a ipfs repo stat.
When i go and look in the data directory under “blocks” folder i see all the data is present (which is approx 25GB in size), but when i try to fetch any of the IPFS/IPLD CID’s which were added before the restart, i couldn’t get the same.

docker run -d --restart unless-stopped --name ipfs_host -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p -p -p -p ipfs/go-ipfs:latest daemon

Would appreciate the help with the following:

  1. Is there any way to recover my data and pin it back to the node?
  2. Is it the right procedure i have followed to restart? If not, what is the better way to restart the docker container so that data is not lost.

Note that, we primarily use the HTTP RPC API to pin json data as ipfs payloads and also IPLD objects.

Following is the go-ipfs version i am using.

go-ipfs version: 0.14.0-dev-5615715
Repo version: 12
System version: arm64/linux
Golang version: go1.18.1

where you running the same go-ipfs version before and after the upgrade? Can you double check that the folders are mounted in the right place inside the container? Are you starting it in the same way as before?

Using the same version before and after.
Not sure what you mean by folders being mounted in the right place, but following is the docker volumes output :

docker inspect -f '{{ .Mounts }}' 7f313e232389
[{volume 684d069c738ad13175851ceca19731ad9d704b3e970fd7e84d2fcb818f16da41 /var/lib/docker/volumes/684d069c738ad13175851ceca19731ad9d704b3e970fd7e84d2fcb818f16da41/_data :/export local  true } {volume e4ac8eac956329af3fad81bf75cf28fa7db368d0d6ae9fb4941d49fd6f7c9f85 /var/lib/docker/volumes/e4ac8eac956329af3fad81bf75cf28fa7db368d0d6ae9fb4941d49fd6f7c9f85/_data /data/ipfs local  true } {volume 342fd04cd8063f588cfa8be901b7b5c5c47ea993ce441a6f06de0b6ca95ec230 /var/lib/docker/volumes/342fd04cd8063f588cfa8be901b7b5c5c47ea993ce441a6f06de0b6ca95ec230/_data :/data/ipfs local  true }]

Except for disabling the --auto-gc flag, I have used the same command as before.

And ipfs repo stat says the repository is empty?

Yes, I only see the count and usage of new files that started getting added after restart.

I have figured out the issue, it was a silly mistake on my part.
I did not create the env variables for data and staging directories…i assumed the default would be picked up from user’s home directory.

When i restarted docker as these env variables were empty ,path for data directory should’ve been picked up from some other location and hence newly initialized. Hence, older data was not visible.

Thanks a lot for the help though.