Name of database on Atlas

our dev app is deployed to Galaxy, using Atlas as the db server.

when i created the db cluster on Atlas, i configured the few things i could and by default it created a database called admin. the connection string it gave me was for the admin database, so that’s what i used in my settings file.

so now all the app collections are in the “admin” database and Atlas support is telling me i shouldn’t be doing that.

how does everyone else handle this? where did i go wrong in my process?

ok, i figured out what happened and why, and after a lot of tedious work figured out the best way to get it all fixed. now it’s awesome and it won’t happen again. phew!

I don’t know what fix was tedious, but you can just move the databases to a new one. The auth string still authenticate agains admin tough.

It’s a 5 min fix to change the database (do not use admin nor local). By default meteor (locally) uses the db called ‘meteor’.

Then to connect to the new db, you should use ‘use DB_NAME’, for example: ‘use meteor’.

You can now whitelist the IPs from Galaxy to for another layer of protection.

yes, it’s a quick fix to actually run the command, but slightly longer to figure out the right command.

for anyone who did what i did, the command is below. it migrates all the non-system collections in the same db, on Atlas, from the admin db to a newly-created meteor db. but it keeps the admin db for the stuff it’s supposed to be used for and auths against the admin db.

i ran this on my local OSX machine in Terminal. and it does it w/o having to download the collections, or do them one at a time.

mongodump --host SERVER-NAME-shard-0/SERVER-NAME-shard-00-00-zh0gu.mongodb.net:27017,SERVER-NAME-shard-00-01-zh0gu.mongodb.net:27017,SERVER-NAME-shard-00-02-zh0gu.mongodb.net:27017 --ssl --authenticationDatabase admin --username USERNAME --password PASSWORD --archive --db admin --excludeCollectionsWithPrefix system | mongorestore --host SERVER-NAME-shard-0/SERVER-NAME-shard-00-00-zh0gu.mongodb.net:27017,SERVER-NAME-shard-00-01-zh0gu.mongodb.net:27017,SERVER-NAME-shard-00-02-zh0gu.mongodb.net:27017 --ssl --authenticationDatabase admin --username USERNAME --password PASSWORD --archive --nsInclude ‘admin.*’ --nsFrom ‘admin.$collection$’ --nsTo ‘meteor.$collection$’