Mongorestore not working for serverless cluster

Hey all, I’m trying to get the test db sample_mflix set up in a serverless cluster so I can run aggregations.

I can connect to my serverless cluster normally with mongosh so I know my auth creds are good but using the same uri with mongorestore gives me:

Failed: error connecting to db server: no reachable servers

Could this be something about my connection?

In the limitations page I found:

“Perform Point-in-Time or Automated Restores from Backup Snapshots”

So is a mongodump with --archive one of these special “backup snapshots”? And if so how do I run mongodump so I can run mongorestore on a serverless cluster?

Or something else?

Thanks.

No i don’t think it is related to limitations
In serverless mongodb min tools version is 100.5.x or later

If you are attempting mongorestore you would have run mongodump.
Was it successful?

Show us the commands you used
Is the mongod up and running where you are trying to import to
Are source and target on same server or different?

I have run:

mongodump --uri="mongodb+srv://<username>@<host>/sample_mflix" --forceTableScan

and:

mongodump --uri="mongodb+srv://<username>@<host>/sample_mflix" --forceTableScan --archive="mflix"

With the --archive option it creates a file and without it creates a dump folder, as usual.

when I run:

mongorestore --host="<host>" --db="sample_mflix" --username="<username>"

or:

mongorestore --host="<host>" --db="sample_mflix" --username="<username>" archive="mflix"

I get the error I posted above:

“Failed: error connecting to db server: no reachable servers”

Is the mongod up and running where you are trying to import to

I’m importing to a serverless cluster which I’m able to mongosh into and run .count and get 0

Are source and target on same server or different?

Both Atlas

Is --host= correct?
What value are you passing in

If uri works for mongodump why not for restore?

Check mongorestore options (like import to replica or a member)

Yes

and I have tried it with and without archive

That question is why I’m here asking for help

I read through that before I asked for helped

Still not clear what exactly the value you are passing for --host
I was hinting at this format

–host=/<:port>,<:port>,<…>

With uri command should be something like this

mongorestore --uri “mongodb+srv://user:password@sandbox.*****.mongodb.net/” --db sampledb dump/sampledb

Note:If it is archive dump you may have to use additional params like gzip depending on the format of your out file
Are you able to restore that dump to your local instance just for testing?
Have you tried Compass as alternative to load the data