title: How to merge N SQLite database files into one if db has the primary field?
body: <p>I have a bunch of SQLite db files, and I need to merge them into one big db files.</p>
  
  <ul>
  <li>How can I do that?</li>
  </ul>
  
  <h3>Added</h3>
  
  <p>Based on <a href="http://old.nabble.com/Attempting-to-merge-large-databases-td18131366.html" rel="nofollow noreferrer">this</a>, I guess those three commands should merge two db into one.</p>
  
  <pre>
  attach './abc2.db' as toMerge;
  insert into test select * from toMerge.test
  detach database toMerge
  </pre>
  
  <p>The problem is the db has PRIMARY KEY field, and I got this message - "Error: PRIMARY KEY must be unique".</p>
  
  <p>This is the test table for the db. </p>
  
  <pre>
  CREATE TABLE test (id integer PRIMARY KEY AUTOINCREMENT,value text,goody text)
  </pre>