A .NET 10 command-line tool that converts Microsoft SQL Server .bacpac exports to SQLite databases.
Requires .NET 10 SDK. No build step needed — the wrapper script handles it.
./bacpac2sqlite --bacpac <path> --sqlite <path> [options]| Option | Default | Description |
|---|---|---|
--bacpac (required) |
Path to .bacpac file |
|
--sqlite (required) |
Path to SQLite output (created if missing) | |
--tables |
all | Table name globs to include |
--exclude |
none | Table name globs to exclude |
--batchSize |
5000 | Rows per transaction batch |
--pragmaFast |
on | Apply fast PRAGMA settings |
--foreignKeysOff |
on | Disable foreign keys during import |
--truncate |
off | Truncate existing tables before import |
--validateCounts |
on | Validate row counts after import |
--bcpProfile |
auto | BCP profile: auto, native, unicode-native |
--inspect |
off | Print archive inventory and exit |
--verbose |
off | Verbose output |
Convert a BACPAC to SQLite:
./bacpac2sqlite --bacpac database.bacpac --sqlite output.dbConvert only specific tables:
./bacpac2sqlite --bacpac database.bacpac --sqlite output.db \
--tables "dbo.Orders" "dbo.Customers"Exclude tables by pattern:
./bacpac2sqlite --bacpac database.bacpac --sqlite output.db \
--exclude "*Log*" "*Audit*"Inspect BACPAC contents without converting:
./bacpac2sqlite --bacpac database.bacpac --inspect --verbose| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Invalid arguments or missing input file |
| 3 | BACPAC parsing error |
| 4 | One or more tables failed (partial success) |
Integers (tinyint, smallint, int, bigint), bit, float, real, uniqueidentifier, decimal/numeric, money/smallmoney, date, time, datetime, datetime2, datetimeoffset, smalldatetime, char/varchar/nvarchar/nchar/text/ntext, binary/varbinary/image, xml, sql_variant, hierarchyid, geometry, geography, timestamp/rowversion.
Computed columns are automatically skipped (they are not stored in BACPAC BCP data).
dotnet test BacpacToSqlite/BacpacToSqlite/
src/
BacpacToSqlite.Cli/ Console application (System.CommandLine)
BacpacToSqlite.Core/ Core library
BcpNative/ BCP binary format parser
Planning/ Table/column metadata
tests/
BacpacToSqlite.Tests/ xUnit tests