title: MongoDB - Users not restored using command mongorestore
body: <p>I'm new to MongoDB and I'm testing some basic backup and restore operations in a single MongoDB instance.</p>
  
  <p>All tests worked fine except for restoring users.</p>
  
  <p>I first created a backup of a test database (<em>db_test</em>) using the following command:</p>
  
  <pre><code>$ mongodump -u adm_dump --authenticationDatabase admin -d db_test --dumpDbUsersAndRoles -o /opt/backup/mongodump_db_test
  </code></pre>
  
  <p><em>adm_dump</em> is a user I created with "restore" and "backup" roles.</p>
  
  <p>2 users are present in <em>db_test</em> database with "readWrite" and "read" roles respectively. So I was expecting these both users to be restored.</p>
  
  <p>Then I restored the database into database <em>db_test_2</em> (not existing):</p>
  
  <pre><code>$ mongorestore -u adm_dump --authenticationDatabase admin -d db_test_2 --restoreDbUsersAndRoles /opt/backup/mongodump_db_test/db_test
  </code></pre>
  
  <p>The new database <em>db_test_2</em> is successfully created (all collections are restored) but users are not restored in <em>db_test2</em>.</p>
  
  <p>Below the log tail:</p>
  
  <pre><code>...
  2016-06-29T18:28:26.429+0200    restoring users from /opt/backup/mongodump_db_test/db_test/$admin.system.users.bson
  2016-06-29T18:28:26.464+0200    roles file '/opt/backup/mongodump_db_test/db_test/$admin.system.roles.bson' is empty; skipping roles restoration
  2016-06-29T18:28:26.464+0200    restoring roles from /opt/backup/mongodump_db_test/db_test/$admin.system.roles.bson
  2016-06-29T18:28:26.468+0200    done
  </code></pre>
  
  <p>I also granted the "userAdmin" role to <em>adm_dump</em> and did operations several times with no success. Should I give another specific role to <em>adm_dump</em> user ?</p>
  
  <p>I read the doc and googled on dumpDbUsersAndRoles / restoreDbUsersAndRoles options but found nothing relevant.</p>
  
  <p>What did I miss to restore users from a dump backup ?</p>
  
  <p>MongoDB version 3.2.1 on CentOS 6.6</p>