title: Convert a Shard Cluster to a Replicated Shard Cluster
body: <p>I've been working with mongo for a few weeks and and building my environment in a dev.  I started with a single node, then moved to a shard cluster, and now want to move to a replicated shard cluster.  From what I read a Replicated Shard Cluster is the best of the best, scalability, durability, performance increase, etc.</p>
  
  <p>I've read most of the (very good) tutorials in their help.  It seems their lessons advise going from single node, to replica set, to sharded replica set, which, unfortunately is the opposite way I did it.  I can't seem to find anything to upgrade a sharded cluster to a replicated shard cluster.</p>
  
  <p>Here are 5 hosts that I have:</p>
  
  <ul>
  <li>APPSERVER </li>
  <li>CONFIGSERVER </li>
  <li>SHARD1 </li>
  <li>SHARD2 </li>
  <li>SHARD3</li>
  </ul>
  
  <p>I started each of the shard servers with:</p>
  
  <pre><code>mongod --shardsvr 
  </code></pre>
  
  <p>Then I started the config server with:</p>
  
  <pre><code>mongod --configsvr 
  </code></pre>
  
  <p>Then I started the mongos process on the APPSERVER with:</p>
  
  <pre><code>mongos --configdb CONFIGSERVER
  </code></pre>
  
  <p>Then in mongos, I added the shards, enabled sharding on my database, and defined a shardkey for a collection:</p>
  
  <pre><code>sh.addShard("SHARD1:27018");//again for 2 and 3
  sh.enableSharding("beacon");
  sh.shardCollection("beacon.alpha2", {"ip":1});
  </code></pre>
  
  <p>I want each of the shards replicated on each of the other two. (right?)  Do I need to bring down the mongod processes on the shards and restart them with different CL parameters? What commands do I need to issue in my mongos shell to get it to replicate?  Should I export all my data, take everything down, restart and reimport?  Again, I see a lot of tutorials on how to create a replica set, but I don't really see anything on how to do a replica set given a sharded system to start with.</p>
  
  <p>Thanks!</p>