python + Sqlite: How to save the changes into a new db file?
<p>After the changes were made to a db file, I want to save the data into a new db file. </p>

<pre><code>import sqlite3
conn = sqlite3.connect('Original.db')
cur = conn.cursor()
# make changes here.
conn.close() #Close without save

connA = sqlite3.connect('NewFile.db')
connA.commit() # Here is my problem. How to save the changed data into this new file?
</code></pre>

<p>Thanks for your help!</p>

<p>UPDATE: My db file is huge. If I make a copy of it at the beginning, it takes to much time. I would rather let it run after I made the changes, to save the starting time.</p>

<p>Each databases have their own table, data, schema, etc. If you just commit those changes on a brand new file, errors will occur.</p>

<p>If you want to save the changed data into a new database, you can make a copy of current database file by using <code>shutil.copyfile</code> and then operate on the new database.</p>

python sqlite