Convert a MongoDB cloned server from replica set to a stand alone server

  • Stop your mongodb server:
    use admin
    db.shutdownServer()
  • Open /etc/mongod.conf and comment the replication.replSetName lines:
    #replication:
       #replSetName: rs0
  • Start your mongo server
  • Go to mongo shell and drop local database:
    use local
    db.dropDatabase()
  • Restart mongo
  • Your mongodb now is PRIMARY