Restore mongodb standalone

Below are the files present in /data/db dir in production db.

/data/db# ls -lrth
total 2.2G
-rw------- 1 mongodb mongodb   46 May  5  2020 WiredTiger
-rw------- 1 mongodb mongodb  114 May  5  2020 storage.bson
-rw------- 1 mongodb mongodb   21 May  5  2020 WiredTiger.lock
drwx------ 2 mongodb mongodb 6.0K May 13  2020 RphLSrH4
drwx------ 2 mongodb mongodb 6.0K May 13  2020 Rtmp36TQ9s
drwx------ 2 mongodb mongodb 6.0K May 14  2020 RtmpU5VhGf
drwx------ 2 mongodb mongodb 6.0K May 14  2020 Rtmp5iOWBZ
drwx------ 2 mongodb mongodb 6.0K May 14  2020 RtmpA6ZerP
drwx------ 2 mongodb mongodb 6.0K May 16  2020 RtmpU81C2J
drwx------ 2 mongodb mongodb 6.0K May 16  2020 RtmpnRL72N
drwx------ 2 mongodb mongodb 6.0K May 16  2020 Rtmpc5BLGI
drwx------ 2 mongodb mongodb 6.0K May 16  2020 RtmpCqEH8v
drwx------ 2 mongodb mongodb 6.0K May 22  2020 RtmpiNBLVk
drwx------ 2 mongodb mongodb 6.0K May 22  2020 RtmpRcEvv0
drwx------ 2 mongodb mongodb 6.0K May 22  2020 RtmpJpTGHu
drwx------ 2 mongodb mongodb 6.0K May 26  2020 RtmpKkjWmv
drwx------ 2 mongodb mongodb 6.0K May 26  2020 Rtmpa4lwb6
drwx------ 2 mongodb mongodb 6.0K May 26  2020 Rtmpt7lBWx
drwx------ 2 mongodb mongodb 6.0K May 26  2020 RtmpAoVvqm
drwx------ 2 mongodb mongodb 6.0K May 26  2020 Rtmprj293v
drwx------ 2 mongodb mongodb 6.0K Jun 12  2020 Rtmpo51iBb
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 RtmpC4fJRe
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 RtmpVQwSul
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 Rtmp6qgLlp
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 Rtmpwwnk3U
drwx------ 2 mongodb mongodb 6.0K Jun 22  2020 RtmpbYNsjh
drwx------ 2 mongodb mongodb 6.0K Jun 22  2020 Rtmpn6Rnss
drwx------ 2 mongodb mongodb 6.0K Jun 22  2020 Rp1sq31l
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RpZDvnEX
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 Rtmpw5UqoC
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RtmpkwIaRu
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RtmpFLzqN8
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RtmpFVVwy0
drwx------ 2 mongodb mongodb 6.0K Jun 26  2020 RtmpeCeFIv
drwx------ 2 mongodb mongodb 6.0K Jun 26  2020 RtmpN3bWlP
drwx------ 2 mongodb mongodb 6.0K Jul 16  2020 Rtmplis6ts
drwx------ 2 mongodb mongodb 6.0K Jul 18  2020 Rtmp2vg0AJ
drwx------ 2 mongodb mongodb 6.0K Jul 21  2020 RtmpFlfKEo
drwx------ 2 mongodb mongodb 6.0K Jul 21  2020 RtmpIL6z4R
drwx------ 2 mongodb mongodb 6.0K Jul 21  2020 RtmpdnPwgb
drwx------ 2 mongodb mongodb 6.0K Jul 22  2020 RtmpINVgFY
drwx------ 2 mongodb mongodb 6.0K Aug  6  2020 RtmpgtVobk
drwx------ 2 mongodb mongodb 6.0K Aug 17  2020 RtmpyrYidj
drwx------ 2 mongodb mongodb 6.0K Aug 17  2020 RtmpLAyxW4
drwx------ 2 mongodb mongodb 6.0K Sep  1  2020 RtmpXUIbiR
-rw-r--r-- 1 mongodb mongodb  45M Sep  1  2020 cded-e214-ff6b-ccfa
drwxr-xr-x 2 mongodb mongodb 6.0K Sep  8  2020 hsperfdata_root
drwxr-xr-x 2 mongodb mongodb  22K Mar 30 18:23 progress
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 collection-4--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 index-5--5138667409853774933.wt
-rw------- 1 mongodb mongodb 168K Jul 15 16:23 index-10--5138667409853774933.wt
-rw------- 1 mongodb mongodb 212K Jul 15 16:23 index-13--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 index-6--5138667409853774933.wt
-rw------- 1 mongodb mongodb 879M Jul 15 16:23 collection-12--5138667409853774933.wt
-rw------- 1 mongodb mongodb 228K Jul 15 16:23 index-14--5138667409853774933.wt
-rw------- 1 mongodb mongodb 500K Jul 15 16:23 collection-8--5138667409853774933.wt
-rw------- 1 mongodb mongodb 140K Jul 15 16:23 index-9--5138667409853774933.wt
-rw------- 1 mongodb mongodb  58M Jul 15 16:23 collection-19--5138667409853774933.wt
-rw------- 1 mongodb mongodb  92K Jul 15 16:23 index-20--5138667409853774933.wt
-rw------- 1 mongodb mongodb  59M Jul 15 16:23 collection-17--5138667409853774933.wt
-rw------- 1 mongodb mongodb  68K Jul 15 16:23 index-18--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 index-3--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 collection-2--5138667409853774933.wt
-rw------- 1 mongodb mongodb  32K Jul 16 02:07 collection-0--5138667409853774933.wt
-rw------- 1 mongodb mongodb  32K Jul 16 02:07 index-1--5138667409853774933.wt
-rw------- 1 mongodb mongodb  32K Jul 16 02:07 _mdb_catalog.wt.1
-rw------- 1 mongodb mongodb  36K Jul 16 02:07 sizeStorer.wt.1
-rw------- 1 mongodb mongodb 4.0K Jul 16 02:07 WiredTigerHS.wt
-rw------- 1 mongodb mongodb  60K Jul 16 12:25 WiredTiger.wt.orig
-rw------- 1 mongodb mongodb 4.0K Jul 16 13:51 WiredTigerLAS.wt
-rw------- 1 mongodb mongodb  16K Jul 16 13:51 collection-0--7947847146613003270.wt
-rw------- 1 mongodb mongodb    2 Jul 16 13:51 mongod.lock
-rw------- 1 mongodb mongodb  16K Jul 16 13:51 index-2--7947847146613003270.wt
-rw------- 1 mongodb mongodb  36K Jul 16 13:52 index-1--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Jul 16 13:52 collection-0--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Jul 16 20:19 _mdb_catalog.wt
drwx------ 2 mongodb mongodb 6.0K Aug  6 19:03 journal
-rw------- 1 mongodb mongodb  36K Aug 19 16:35 index-7--1930030124829508624.wt
-rw------- 1 mongodb mongodb  36K Aug 19 16:37 index-9--1930030124829508624.wt
-rw------- 1 mongodb mongodb 5.8M Aug 19 16:37 collection-8--1930030124829508624.wt
-rw------- 1 mongodb mongodb 5.3M Aug 19 16:37 collection-6--1930030124829508624.wt
-rw------- 1 mongodb mongodb  52K Aug 19 16:37 index-5--1930030124829508624.wt
-rw------- 1 mongodb mongodb  52K Aug 19 16:37 index-4--1930030124829508624.wt
-rw------- 1 mongodb mongodb  48M Aug 19 16:37 collection-3--1930030124829508624.wt
-rw------- 1 mongodb mongodb  52K Aug 19 16:37 index-2--1930030124829508624.wt
-rw------- 1 mongodb mongodb  44K Aug 19 16:37 index-1--1930030124829508624.wt
-rw------- 1 mongodb mongodb  84K Aug 19 16:37 collection-0--1930030124829508624.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:02 index-3--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:47 index-4--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:47 collection-2--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:48 sizeStorer.wt
-rw------- 1 mongodb mongodb  84K Aug 19 18:48 WiredTiger.wt
-rw------- 1 mongodb mongodb 1.2K Aug 19 18:48 WiredTiger.turtle
drwx------ 2 mongodb mongodb 6.0K Aug 19 18:52 diagnostic.data

How were you connecting before?
If access control enabled you cannot connect by issuing just mongo

Did you try to login with a valid userid/pwd authenticating against admin DB?

1 Like

Yes am able to connect now, but old data is not showing it’s restores, when i given mongo

show dbs
admin 0.000GB
config 0.000GB
local 0.000GB

theseare the dbs only showing, i tried to restore from /data/db dir in production copied all the files from /data/db dir from production into local system in E:/restore_bacup and run mongod --dbpath E:/restore_backup

any suggestions, how t restore the old data from /data/db (WT files present in prod env) as DBAs are suggesting all the old files before July 13 are present in this dir /data/db .

Strange

Was any other mongod running on your Windows local host on same port 27017?
I have read in the docs that you should stop any mongod service before doing this dbpath restore
Also check your Windows services from taskmanager.If you see any running mongod service stop it and then connect to mongo again and see
Meanwhile leave the session where you started mongod with --dbpath “E:\restore_backup”
This session should always be up as you ran it in foreground.If you close it or ctl+c you will not be able to connect from another cmd prompt window

2 Likes

I stopped the mongod

C:\Program Files\MongoDB\Server\5.0\bin>net stop MongoDB
The MongoDB Server (MongoDB) service is not started.

rage":{"dbPath":"E:\\restore_backup"}}}}
{"t":{"$date":"2021-08-21T20:24:17.907+05:30"},"s":"E",  "c":"CONTROL",  "id":20557,   "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"DBPathInUse: Unable to create/open the lock file: E:\\restore_backup\\mongod.lock (The process cannot access the file because it is being used by another process.). Ensure the user executing mongod is the owner of the lock file and has the appropriate permissions. Also make sure that another mongod instance is not already running on the E:\\restore_backup directory"}}
{"t":{"$date":"2021-08-21T20:24:17.907+05:30"},"s":"I",  "c":"REPL",     "id":4784900, "ctx":"initandlisten","msg":"Stepping down the ReplicationCoordinator for shutdown","attr":{"waitTimeMillis":15000}}
{"t":{"$date":"2021-08-21T20:24:17.908+05:30"},"s":"I",  "c":"COMMAND",  "id":4784901, "ctx":"initandlisten","msg":"Shutting down the MirrorMaestro"}
{"t":{"$date":"2021-08-21T20:24:17.908+05:30"},"s":"I",  "c":"SHARDING", "id":4784902, "ctx":"initandlisten","msg":"Shutting down the WaitForMajorityService"}
{"t":{"$date":"2021-08-21T20:24:17.909+05:30"},"s":"I",  "c":"NETWORK",  "id":20562,   "ctx":"initandlisten","msg":"Shutdown: going to close listening sockets"}
{"t":{"$date":"2021-08-21T20:24:17.909+05:30"},"s":"I",  "c":"NETWORK",  "id":4784905, "ctx":"initandlisten","msg":"Shutting down the global connection pool"}
{"t":{"$date":"2021-08-21T20:24:17.910+05:30"},"s":"I",  "c":"CONTROL",  "id":4784906, "ctx":"initandlisten","msg":"Shutting down the FlowControlTicketholder"}
{"t":{"$date":"2021-08-21T20:24:17.910+05:30"},"s":"I",  "c":"-",        "id":20520,   "ctx":"initandlisten","msg":"Stopping further Flow Control ticket acquisitions."}
{"t":{"$date":"2021-08-21T20:24:17.911+05:30"},"s":"I",  "c":"NETWORK",  "id":4784918, "ctx":"initandlisten","msg":"Shutting down the ReplicaSetMonitor"}
{"t":{"$date":"2021-08-21T20:24:17.911+05:30"},"s":"I",  "c":"SHARDING", "id":4784921, "ctx":"initandlisten","msg":"Shutting down the MigrationUtilExecutor"}
{"t":{"$date":"2021-08-21T20:24:17.913+05:30"},"s":"I",  "c":"ASIO",     "id":22582,   "ctx":"MigrationUtil-TaskExecutor","msg":"Killing all outstanding egress activity."}
{"t":{"$date":"2021-08-21T20:24:17.913+05:30"},"s":"I",  "c":"COMMAND",  "id":4784923, "ctx":"initandlisten","msg":"Shutting down the ServiceEntryPoint"}
{"t":{"$date":"2021-08-21T20:24:17.918+05:30"},"s":"I",  "c":"CONTROL",  "id":4784925, "ctx":"initandlisten","msg":"Shutting down free monitoring"}
{"t":{"$date":"2021-08-21T20:24:17.918+05:30"},"s":"I",  "c":"CONTROL",  "id":4784927, "ctx":"initandlisten","msg":"Shutting down the HealthLog"}
{"t":{"$date":"2021-08-21T20:24:17.920+05:30"},"s":"I",  "c":"CONTROL",  "id":4784928, "ctx":"initandlisten","msg":"Shutting down the TTL monitor"}
{"t":{"$date":"2021-08-21T20:24:17.920+05:30"},"s":"I",  "c":"CONTROL",  "id":4784929, "ctx":"initandlisten","msg":"Acquiring the global lock for shutdown"}
{"t":{"$date":"2021-08-21T20:24:17.921+05:30"},"s":"I",  "c":"-",        "id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"}
{"t":{"$date":"2021-08-21T20:24:17.922+05:30"},"s":"I",  "c":"FTDC",     "id":4784926, "ctx":"initandlisten","msg":"Shutting down full-time data capture"}
{"t":{"$date":"2021-08-21T20:24:17.922+05:30"},"s":"I",  "c":"CONTROL",  "id":20565,   "ctx":"initandlisten","msg":"Now exiting"}
{"t":{"$date":"2021-08-21T20:24:17.923+05:30"},"s":"I",  "c":"CONTROL",  "id":23138,   "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":100}}

C:\Program Files\MongoDB\Server\5.0\bin>
C:\Program Files\MongoDB\Server\5.0\bin>
C:\Program Files\MongoDB\Server\5.0\bin>mongo
MongoDB shell version v5.0.2
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb

Any suggestions, mongo is not getting connected.

Well, despite being helped with appropriate directives, the fact that you are still struglying with this makes me want to suggest that you either

  1. take M103 course for MongoDB university
    or
  2. hier a consultant
2 Likes

chris/ steevej help him to connect to restored DB

bp_sin definitely there is a mixup in your restore steps

i think you had another mongod running on same port
That’s why it says another instance using lock file

It is bit confusing but mongod works differently on different os

On Windows you can have two mongods running on same port but with different dirpath
On Unix it won’t allow to start two mongods on same port

So in your case when you restored WT files and started mongod with your restored path it started and waiting for connections
When you issued mongo it connected to the first instance which started as service
When you start mongod or mongo without port it will take default port 27017

Your options now:

  • Kill all mongods (shutdown gracefully) Remove lock files
  • Start freshly mongod on your restored path (E:/…/)
  • Disable your default mongod from services (so that it will not start auto on reboot)
  • Alternately you can start mongod on a new port say 28000:

mongod --port 28000 --dbpath=(E:/…/)

  • Once mongod is up you have to connect by

mongo --port 28000

Disadvantage with starting mongod on on default port is you have to use the port_number while connecting

Refer to the mongo documentation/University courses and take help from your DBA team

2 Likes

Thanks Ramachandra,

I have followed the steps able to connect now from ort 28000 in mongo but still data is showing 0 in size DBs

> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
> use admin
switched to db admin
> db.shutdownServer();
server should be down...

Got the message below in mongod

{"t":{"$date":"2021-08-21T23:49:22.214+05:30"},"s":"I",  "c":"STORAGE",  "id":22281,   "ctx":"conn1","msg":"shutdown: removing fs lock..."}
{"t":{"$date":"2021-08-21T23:49:22.216+05:30"},"s":"I",  "c":"-",        "id":4784931, "ctx":"conn1","msg":"Dropping the scope cache for shutdown"}
{"t":{"$date":"2021-08-21T23:49:22.221+05:30"},"s":"I",  "c":"FTDC",     "id":4784926, "ctx":"conn1","msg":"Shutting down full-time data capture"}
{"t":{"$date":"2021-08-21T23:49:22.221+05:30"},"s":"I",  "c":"FTDC",     "id":20626,   "ctx":"conn1","msg":"Shutting down full-time diagnostic data capture"}
{"t":{"$date":"2021-08-21T23:49:22.225+05:30"},"s":"I",  "c":"CONTROL",  "id":20565,   "ctx":"conn1","msg":"Now exiting"}
{"t":{"$date":"2021-08-21T23:49:22.226+05:30"},"s":"I",  "c":"CONTROL",  "id":23138,   "ctx":"conn1","msg":"Shutting down","attr":{"exitCode":0}}

Also stopped manually :

C:\Program Files\MongoDB\Server\5.0\bin>net stop MongoDB
The MongoDB Server (MongoDB) service is not started.

More help is available by typing NET HELPMSG 3521.

and started again the restore with below port command:

C:\Program Files\MongoDB\Server\5.0\bin>mongod --port 28000 --dbpath E:/restore_backup
{"t":{"$date":"2021-08-21T23:53:43.927+05:30"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":true}}}
{"t":{"$date":"2021-08-21T23:53:43.933+05:30"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2021-08-21T23:53:44.578+05:30"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2021-08-21T23:53:44.579+05:30"},"s":"I",  "c":"NETWORK",  "id":4648602, "ctx":"main","msg":"Implicit TCP FastOpen in use."}
{"t":{"$date":"2021-08-21T23:53:44.584+05:30"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2021-08-21T23:53:44.585+05:30"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","ns":"config.tenantMigrationDonors"}}

in one terminal and open the session in another terminal to login to mongod

am able to connect to mongo with port 28000, but again data is not stored, all dbs showing 0.0 G data

C:\Program Files\MongoDB\Server\5.0\bin>mongo --port 28000
MongoDB shell version v5.0.2
connecting to: mongodb://127.0.0.1:28000/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("2573c6ec-3eac-42c6-ad6d-b685ef500e05") }
MongoDB server version: 5.0.2
================
Warning: the "mongo" shell has been superseded by "mongosh",
which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in
an upcoming release.
We recommend you begin using "mongosh".
For installation instructions, see
https://docs.mongodb.com/mongodb-shell/install/
================
---
The server generated these startup warnings when booting:
        2021-08-22T00:04:18.931+05:30: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
        2021-08-22T00:04:18.933+05:30: This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning
---
---
        Enable MongoDB's free cloud-based monitoring service, which will then receive and display
        metrics about your deployment (disk utilization, CPU, operation statistics, etc).

        The monitoring data will be available on a MongoDB website with a unique URL accessible to you
        and anyone you share the URL with. MongoDB may use this information to make product
        improvements and to suggest MongoDB products and deployment options to you.

        To enable free monitoring, run the following command: db.enableFreeMonitoring()
        To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---
> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
>

Any suggestion here, DBA team is saying that they have all the files for older data to restore in /data/db dir in standalone prod db, i copied all the files to local system in E:\restore_backup and run the above commands but data is not present it’s showing 0 there.

Hi @bp_sin,

We’ve been discussing this issue for just over a week and haven’t made much progress beyond standing up a local MongoDB deployment which does not appear to have the data you are looking for.

The best advice I can offer at this stage is that it is time to concede that you do not yet have sufficient MongoDB admin experience to resolve this issue without bringing in an expert who can help with hands-on-keyboard resolution. You’ve mentioned several times that there is a DBA team providing some suggestions and that they are certain the desired data should be available. I would appeal to the DBAs (and/or your manager) for assistance and be honest about your current lack of MongoDB admin knowledge.

As @steevej suggested, further study like the free M103: Basic Cluster Administration course at MongoDB University will provide you with the essential background knowledge you need to be successful with tasks like this in future. The M103 course is an estimated 9.5 hours of effort and includes hands-on labs and quizzes.

Regards,
Stennie

2 Likes

Thanks Stennie,

I am going through the course M103 and documentation.

I followed all the steps:

  1. Taken all the prod files backup which is having old data before July 13 in the dir: /data/db
    and copied into local system at location E:/restore_backup dir.
  2. Started Mongod with port 28000 below on local system where mongdb is installed with --dbpath E:/restore_backup, to restore the old data before july 13 from local system dir: E:/restore_backup
C:\Program Files\MongoDB\Server\5.0\bin>mongod --dbpath E:/restore_backup --port 28000
{"t":{"$date":"2021-08-22T16:44:08.002+05:30"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
  1. on Another terminal connected through mongo db but still am able to see only below dbs, with no data, any suggestion on this.
C:\Program Files\MongoDB\Server\5.0\bin>mongo --port 28000
MongoDB shell version v5.0.2
connecting to: mongodb://127.0.0.1:28000/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("be6bd411-f1fe-45c1-bdb7-e858ce9403b6") }
MongoDB server version: 5.0.2
================
---
> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
>

Any key point which am missing, thanks

Thanks Ramachandra for support.

As per our Application design and Adba team they are saying we have all the data present in /data/db dir.

below are the files present in /data/db dir in production db, apart from this files no backups as per ADBA and application team, they have lost old data on 13th July, i started taking mongodump for all prod db regularly for now, but we want to restore old data before 13th July also

/data/db# ls -lrth
total 2.2G
-rw------- 1 mongodb mongodb   46 May  5  2020 WiredTiger
-rw------- 1 mongodb mongodb  114 May  5  2020 storage.bson
-rw------- 1 mongodb mongodb   21 May  5  2020 WiredTiger.lock
drwx------ 2 mongodb mongodb 6.0K May 13  2020 RphLSrH4
drwx------ 2 mongodb mongodb 6.0K May 13  2020 Rtmp36TQ9s
drwx------ 2 mongodb mongodb 6.0K May 14  2020 RtmpU5VhGf
drwx------ 2 mongodb mongodb 6.0K May 14  2020 Rtmp5iOWBZ
drwx------ 2 mongodb mongodb 6.0K May 14  2020 RtmpA6ZerP
drwx------ 2 mongodb mongodb 6.0K May 16  2020 RtmpU81C2J
drwx------ 2 mongodb mongodb 6.0K May 16  2020 RtmpnRL72N
drwx------ 2 mongodb mongodb 6.0K May 16  2020 Rtmpc5BLGI
drwx------ 2 mongodb mongodb 6.0K May 16  2020 RtmpCqEH8v
drwx------ 2 mongodb mongodb 6.0K May 22  2020 RtmpiNBLVk
drwx------ 2 mongodb mongodb 6.0K May 22  2020 RtmpRcEvv0
drwx------ 2 mongodb mongodb 6.0K May 22  2020 RtmpJpTGHu
drwx------ 2 mongodb mongodb 6.0K May 26  2020 RtmpKkjWmv
drwx------ 2 mongodb mongodb 6.0K May 26  2020 Rtmpa4lwb6
drwx------ 2 mongodb mongodb 6.0K May 26  2020 Rtmpt7lBWx
drwx------ 2 mongodb mongodb 6.0K May 26  2020 RtmpAoVvqm
drwx------ 2 mongodb mongodb 6.0K May 26  2020 Rtmprj293v
drwx------ 2 mongodb mongodb 6.0K Jun 12  2020 Rtmpo51iBb
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 RtmpC4fJRe
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 RtmpVQwSul
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 Rtmp6qgLlp
drwx------ 2 mongodb mongodb 6.0K Jun 19  2020 Rtmpwwnk3U
drwx------ 2 mongodb mongodb 6.0K Jun 22  2020 RtmpbYNsjh
drwx------ 2 mongodb mongodb 6.0K Jun 22  2020 Rtmpn6Rnss
drwx------ 2 mongodb mongodb 6.0K Jun 22  2020 Rp1sq31l
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RpZDvnEX
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 Rtmpw5UqoC
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RtmpkwIaRu
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RtmpFLzqN8
drwx------ 2 mongodb mongodb 6.0K Jun 25  2020 RtmpFVVwy0
drwx------ 2 mongodb mongodb 6.0K Jun 26  2020 RtmpeCeFIv
drwx------ 2 mongodb mongodb 6.0K Jun 26  2020 RtmpN3bWlP
drwx------ 2 mongodb mongodb 6.0K Jul 16  2020 Rtmplis6ts
drwx------ 2 mongodb mongodb 6.0K Jul 18  2020 Rtmp2vg0AJ
drwx------ 2 mongodb mongodb 6.0K Jul 21  2020 RtmpFlfKEo
drwx------ 2 mongodb mongodb 6.0K Jul 21  2020 RtmpIL6z4R
drwx------ 2 mongodb mongodb 6.0K Jul 21  2020 RtmpdnPwgb
drwx------ 2 mongodb mongodb 6.0K Jul 22  2020 RtmpINVgFY
drwx------ 2 mongodb mongodb 6.0K Aug  6  2020 RtmpgtVobk
drwx------ 2 mongodb mongodb 6.0K Aug 17  2020 RtmpyrYidj
drwx------ 2 mongodb mongodb 6.0K Aug 17  2020 RtmpLAyxW4
drwx------ 2 mongodb mongodb 6.0K Sep  1  2020 RtmpXUIbiR
-rw-r--r-- 1 mongodb mongodb  45M Sep  1  2020 cded-e214-ff6b-ccfa
drwxr-xr-x 2 mongodb mongodb 6.0K Sep  8  2020 hsperfdata_root
drwxr-xr-x 2 mongodb mongodb  22K Mar 30 18:23 progress
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 collection-4--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 index-5--5138667409853774933.wt
-rw------- 1 mongodb mongodb 168K Jul 15 16:23 index-10--5138667409853774933.wt
-rw------- 1 mongodb mongodb 212K Jul 15 16:23 index-13--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 index-6--5138667409853774933.wt
-rw------- 1 mongodb mongodb 879M Jul 15 16:23 collection-12--5138667409853774933.wt
-rw------- 1 mongodb mongodb 228K Jul 15 16:23 index-14--5138667409853774933.wt
-rw------- 1 mongodb mongodb 500K Jul 15 16:23 collection-8--5138667409853774933.wt
-rw------- 1 mongodb mongodb 140K Jul 15 16:23 index-9--5138667409853774933.wt
-rw------- 1 mongodb mongodb  58M Jul 15 16:23 collection-19--5138667409853774933.wt
-rw------- 1 mongodb mongodb  92K Jul 15 16:23 index-20--5138667409853774933.wt
-rw------- 1 mongodb mongodb  59M Jul 15 16:23 collection-17--5138667409853774933.wt
-rw------- 1 mongodb mongodb  68K Jul 15 16:23 index-18--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 index-3--5138667409853774933.wt
-rw------- 1 mongodb mongodb  36K Jul 15 16:23 collection-2--5138667409853774933.wt
-rw------- 1 mongodb mongodb  32K Jul 16 02:07 collection-0--5138667409853774933.wt
-rw------- 1 mongodb mongodb  32K Jul 16 02:07 index-1--5138667409853774933.wt
-rw------- 1 mongodb mongodb  32K Jul 16 02:07 _mdb_catalog.wt.1
-rw------- 1 mongodb mongodb  36K Jul 16 02:07 sizeStorer.wt.1
-rw------- 1 mongodb mongodb 4.0K Jul 16 02:07 WiredTigerHS.wt
-rw------- 1 mongodb mongodb  60K Jul 16 12:25 WiredTiger.wt.orig
-rw------- 1 mongodb mongodb 4.0K Jul 16 13:51 WiredTigerLAS.wt
-rw------- 1 mongodb mongodb  16K Jul 16 13:51 collection-0--7947847146613003270.wt
-rw------- 1 mongodb mongodb    2 Jul 16 13:51 mongod.lock
-rw------- 1 mongodb mongodb  16K Jul 16 13:51 index-2--7947847146613003270.wt
-rw------- 1 mongodb mongodb  36K Jul 16 13:52 index-1--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Jul 16 13:52 collection-0--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Jul 16 20:19 _mdb_catalog.wt
drwx------ 2 mongodb mongodb 6.0K Aug  6 19:03 journal
-rw------- 1 mongodb mongodb  36K Aug 19 16:35 index-7--1930030124829508624.wt
-rw------- 1 mongodb mongodb  36K Aug 19 16:37 index-9--1930030124829508624.wt
-rw------- 1 mongodb mongodb 5.8M Aug 19 16:37 collection-8--1930030124829508624.wt
-rw------- 1 mongodb mongodb 5.3M Aug 19 16:37 collection-6--1930030124829508624.wt
-rw------- 1 mongodb mongodb  52K Aug 19 16:37 index-5--1930030124829508624.wt
-rw------- 1 mongodb mongodb  52K Aug 19 16:37 index-4--1930030124829508624.wt
-rw------- 1 mongodb mongodb  48M Aug 19 16:37 collection-3--1930030124829508624.wt
-rw------- 1 mongodb mongodb  52K Aug 19 16:37 index-2--1930030124829508624.wt
-rw------- 1 mongodb mongodb  44K Aug 19 16:37 index-1--1930030124829508624.wt
-rw------- 1 mongodb mongodb  84K Aug 19 16:37 collection-0--1930030124829508624.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:02 index-3--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:47 index-4--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:47 collection-2--7067830708941503295.wt
-rw------- 1 mongodb mongodb  36K Aug 19 18:48 sizeStorer.wt
-rw------- 1 mongodb mongodb  84K Aug 19 18:48 WiredTiger.wt
-rw------- 1 mongodb mongodb 1.2K Aug 19 18:48 WiredTiger.turtle
drwx------ 2 mongodb mongodb 6.0K Aug 19 18:52 diagnostic.data

Hi,

Any suggestion in standalone prod db how can we implement these steps, without impacting prod data present in collection documents.

Can we create user and then we can try to import live data of /data/db dir, to check whether old data before 13th July is inserted.

Hi @bp_sin,

It looks like you have a deployment successfully running MongoDB 5.0.2. If there were no startup errors in the MongoDB server log and the contents of your directory are as described, it seems like the backup files provided do not contain the data you expected.

Unfortunately I think we’ve gone as far as possible in this discussion topic given your current experience.

You should discuss options with your DBA team or hire a consultant with appropriate expertise.

Confirming the data you want to export is queryable by connecting to a standalone server is a prerequisite to any further steps like exporting relevant data with mongodump. It seems like you either do not have the expected data or have some misstep in standing up a backup in a standalone environment.

Regards,
Stennie

4 Likes

Hi @bp_sin

Just to add a small point to the discussion here, the whole of WiredTiger’s dbpath directory acts as a single unit. You can’t just pick and choose individual files, and expect WiredTiger to be able do a point-in-time restore. WiredTiger doesn’t work like that, unfortunately.

I would reiterate the fact that if you don’t have the backup for the state of the database on the 13th July, then you can’t realistically restore what you don’t have. Individual files’ last updated date is not relevant for the operation of WiredTiger.

Best regards
Kevin

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.