Library Version 18.1.25

Data Migration
Prev | Chapter 6. Administrating Berkeley DB SQL Databases | Next

## Data Migration

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.

### Migration Using the Shells

To migrate your data from SQLite to a Berkeley DB database:

1. Make sure your application is shutdown.

2. Open the SQLite database within the sqlite3 shell.

3. Execute the `.output` command to specify the location where you want to dump data.

4. Dump the database using the SQLite `.dump` command.

5. Close the sqlite3 shell and open the Berkeley DB dbsql shell.

6. 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.

Prev | Up | Next
Syncing with Oracle Databases | Home | Catastrophic Recovery