title: How do I create a solr core with the data from an existing one?
body: <p><em>Solr 1.4 Enterprise Search Server</em> recommends doing large updates on a copy of the core, and then swapping it in for the main core. I am following these steps:</p>
  
  <ol>
  <li>Create prep core: <a href="http://localhost:8983/solr/admin/cores?action=CREATE&amp;name=prep&amp;instanceDir=main" rel="noreferrer">http://localhost:8983/solr/admin/cores?action=CREATE&amp;name=prep&amp;instanceDir=main</a></li>
  <li>Perform index update, then commit/optimize on prep core.</li>
  <li>Swap main and prep core: <a href="http://localhost:8983/solr/admin/cores?action=SWAP&amp;core=main&amp;other=prep" rel="noreferrer">http://localhost:8983/solr/admin/cores?action=SWAP&amp;core=main&amp;other=prep</a></li>
  <li>Unload prep core: <a href="http://localhost:8983/solr/admin/cores?action=UNLOAD&amp;core=prep" rel="noreferrer">http://localhost:8983/solr/admin/cores?action=UNLOAD&amp;core=prep</a></li>
  </ol>
  
  <p>The problem I am having is, the core created in step 1 doesn't have any data in it. If I am going to do a full index of everything and the kitchen sink, that would be fine, but if I just want to update a (large) subset of the documents - that's obviously not going to work.</p>
  
  <p>(I could merge the cores, but part of what I'm trying to do is get rid of any deleted documents without trying to make a list of them.)</p>
  
  <p>Is there some flag to the CREATE action that I'm missing? The <a href="http://wiki.apache.org/solr/CoreAdmin" rel="noreferrer">Solr Wiki page for CoreAdmin</a> is a little sparse on details.</p>
  
  <h1>Possible Solution: Replication</h1>
  
  <p>Someone on solr-user suggested using replication. To use it in this scenario would (to my understanding) require the following steps:</p>
  
  <ol>
  <li>Create a new PREP core based off the config of the MAIN core</li>
  <li>Change the config of the MAIN core to be a master</li>
  <li>Change the config of the PREP core to be a slave</li>
  <li>Cause/wait for a sync?</li>
  <li>change the config of the PREP core to no longer be a slave</li>
  <li>Perform index update, then commit/optimize on PREP core.</li>
  <li>Swap PREP and MAIN cores</li>
  </ol>
  
  <p>A simpler replication-based setup would be to configure a permanent PREP core that is always the master. The MAIN core (on as many servers as needed) could then be a slave of the PREP core. Indexing could happen on the PREP core as fast or as slow as necessary.</p>
  
  <h1>Possible Solution: Permanent PREP core and double-updating</h1>
  
  <p>Another idea I came up with was this (also involving a permanent PREP core):</p>
  
  <ol>
  <li>Perform index update, then commit/optimize on PREP core.</li>
  <li>Swap PREP and MAIN cores.</li>
  <li>Re-perform index update, then commit/optimize on what is now the PREP core. It now has the same data as the MAIN core (in theory) and will be around, ready for the next index operation.</li>
  </ol>