If you have a database created by SQLite, you can migrate it to a Berkeley DB database for use with the BDB SQL interface. For production applications, you should do this only when your application is shutdown.
All data and schema supported by SQLite can be migrated to a Berkeley DB database.
To migrate your data from SQLite to a Berkeley DB database:
Make sure your application is shutdown.
Open the SQLite database within the sqlite3 shell.
Execute the .output
command to
specify the location where you want to dump data.
Dump the database using the SQLite
.dump
command.
Close the sqlite3 shell and open the Berkeley DB dbsql shell.
Load the dumped data using the
.read
command.
Note that you can migrate in the reverse direction as well.
Dump the Berkeley DB database by calling .dump
from within the Berkeley DB
dbsql shell,
and load it into SQLite by .read
from within
SQLite's sqlite3 shell.