title: How to modify replica set config?
body: <p>I have a mongo 2 node cluster running, with this replica set config.</p>
  
  <pre><code>config = {_id: "repl1", members:[
  {_id: 0, host: 'localhost:15000'},
  {_id: 1, host: '192.168.2.100:15000'}]
  }
  </code></pre>
  
  <p>I have to move these both nodes on to new servers. I have copied everything from old to new servers, but I'm running into issues while reconfiguring the replica config due to ip change on the 2nd node.</p>
  
  <p>I have tried this.</p>
  
  <pre><code>config = {_id: "repl1", members:[
   {_id: 0, host: 'localhost:15000'},
  {_id: 1, host: '192.168.2.200:15000'}]
  }
     rs.reconfig(config)  
     {
  
  
  "startupStatus" : 1,
  "errmsg" : "loading local.system.replset config (LOADINGCONFIG)",
  "ok" : 0
  }
  </code></pre>
  
  <p>It shows above message, but change is not happening.</p>
  
  <p>I also tried changing replica set name but pointing to the same data dirs.
  I am getting the following error:</p>
  
  <pre><code>rs.initiate() 
  {
  "errmsg" : "local.oplog.rs is not empty on the initiating member. cannot initiate.",
  "ok" : 0
  }
  </code></pre>
  
  <p>What are the right steps to change the IP but keeping the data on the 2nd node, or do i need to recreate/resync the 2nd node?</p>