title: MongoDB: sync dbs from master to replica set
body: <p><strong>Step1- I have following collections in my main db [running on port 27017]</strong></p>
  
  <p>$mongo </p>
  
  <p>$show dbs</p>
  
  <blockquote>
    <p>show dbs
    DB        0.078GB</p>
  </blockquote>
  
  <p>admin     (empty)</p>
  
  <p>auditing</p>
  
  <p>local  </p>
  
  <p>university</p>
  
  <p>test</p>
  
  <p><strong>Step2- Now I am creating replica using below command</strong></p>
  
  <p>$mongod --dbpath ~/mongodb_data_dir/mongo/data0 --replSet auditlogreplySet --port 27018 </p>
  
  <p>$mongod --dbpath ~/mongodb_data_dir/mongo/data1 --replSet auditlogreplySet --port 27019</p>
  
  <p>$mongod --dbpath ~/mongodb_data_dir/mongo/data2 --replSet auditlogreplySet --port 27020</p>
  
  <p><strong>Step3- running mongo for port 27018</strong></p>
  
  <p>$ mongo --port 27018</p>
  
  <p>$show dbs</p>
  
  <p>admin  (empty)</p>
  
  <p>local  0.328GB</p>
  
  <p>Query: is it possible to sync all dbs from port 27017(main DB) to replica 27018? Please help. so that I can see all the dbs existing in main db in replica set.</p>