MongoDB empty after upgrading docker-compose?
See original GitHub issueI’m not sure what happened but all my data is gone somehow. I started Wekan as usual running docker-compose up
and noticed some unusual lines in the output:
wekandb_1 | 2016-04-23T12:59:37.721+0000 I INDEX [initandlisten] allocating new ns file /data/db/local.ns, filling with zeroes...
wekandb_1 | 2016-04-23T12:59:37.852+0000 I STORAGE [FileAllocator] allocating new datafile /data/db/local.0, filling with zeroes...
wekandb_1 | 2016-04-23T12:59:37.852+0000 I STORAGE [FileAllocator] creating directory /data/db/_tmp
wekandb_1 | 2016-04-23T12:59:37.859+0000 I STORAGE [FileAllocator] done allocating datafile /data/db/local.0, size: 64MB, took 0.004 secs
[...]
wekandb_1 | 2016-04-23T12:59:38.524+0000 I INDEX [conn5] allocating new ns file /data/db/wekan.ns, filling with zeroes...
wekandb_1 | 2016-04-23T12:59:38.598+0000 I STORAGE [FileAllocator] allocating new datafile /data/db/wekan.0, filling with zeroes...
wekandb_1 | 2016-04-23T12:59:38.601+0000 I STORAGE [FileAllocator] done allocating datafile /data/db/wekan.0, size: 64MB, took 0.002 secs
wekandb_1 | 2016-04-23T12:59:38.605+0000 I INDEX [conn5] build index on: wekan.users properties: { v: 1, unique: true, key: { username: 1 }, name: "username_1", ns: "wekan.users", safe: true, sparse: 1 }
I tried to run mongodump
and indeed all collections are empty. The only change I can think of is upgrading docker-compose from 1.6.2 to 1.7.0 but I can’t find anything related in their changelog. Any ideas what might have gone wrong and how to recover my data? Thanks a lot!
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
docker compose - mongodb collection lost after successful build
The problem is happening because VOLUMES defined in Dockerfile are auto mounted now. And the content is blank, so you are not getting...
Read more >MongoDB Docker container not starting properly - Replication
When the docker stack is deployed, two of the containers are up and running, but the third one is taking a long time...
Read more >After docker-compose restart of mongodb , data got deleted ...
Update : wrapped the compose file content in a code block. ... By the looks of it, you did it correctly, can you...
Read more >How To Run MongoDB as a Docker Container - BMC Software
Installing Docker Compose. We can use the command line interface (CLI) to create and manage Docker containers. However, the CLI can be tedious ......
Read more >Using MongoDB with Docker - Earthly Blog
You can also leave fields empty in situations where a lot of data is missing. MongoDB can be run in a Docker container....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@infertux It worked!
The new install had created a new ‘data’ directory to my wekan install directory. By your directions I did
mv data /tmp/
a little digging to find the volume (turned out to be the first in …/docker/volumes)mv /var/lib/docker/volumes/$OLD_VOLUME_ID/_data data
Thanks again a thousand times!
@simopaasisalo I found the right volume with
tree /var/lib/docker/volumes/
and saw some.bson
files (MongoDB file format). Hope that helps.