v0.6.0-rc.1
HomeDocumentationGoing deeper

Bring the old data along.

Move supported earlier stores to native encryption while preserving the original records.

Choose the right migration path

Direct migration accepts supported non-native BsonLite 0.4/0.5 stores. Native stores should use encrypted backup/restore. Older legacy stores need an encrypted export/restore step into a supported non-native store first. Changing metadata or flags does not encrypt existing plaintext data.

Preserve the originals

Keep the original Database, metadata and matching vault. Close applications using either store before migration. Choose a new destination outside the source directory.

Run a migration

javascript
await BsonLite.disconnect();

const result = await BsonLite.migrate({
  sourceDirectory: './Database',
  directory: './DatabaseEncrypted'
});

await BsonLite.connect({ directory: './DatabaseEncrypted' });

The migrator copies over authenticated TLS and creates the destination with native encryption. It preserves BSON types, collection settings, supported indexes and views, and verifies collection counts. It does not overwrite the original records or securely erase the old copy.

Interrupted or unsupported migrations

An interrupted destination remains marked incomplete and cannot be opened as a completed database. Unsupported special collections and incompatible scope are refused. Investigate the error and preserve the source; do not hand-edit a migration marker to force a partial store open.

The source store retains its original encryption requirements. If earlier data depended on OS encryption, preserve that protection while reading the source. Use native encryption for new databases instead of choosing a legacy mode to bypass a migration requirement.

Documentation for BsonLite 0.6.0-rc.1. View SDK source · Download the validated SDK