Skip to main content
Version: 1.7 (Latest)

FASTBCP_APPLY_SOURCEDB_LOGS

Overview​

A SQL Server full or differential backup holds more than its data pages: it carries the part of the transaction log written while it was being taken, and a .bak file can also hold log backups written to it (BACKUP LOG ... WITH NOINIT to the file of the full backup).

By default, --connectiontype backup_mssql reads a table as its pages are in the backup, without that log. Set FASTBCP_APPLY_SOURCEDB_LOGS to true to apply it: the table is read as it is at the end of the log the backup files hold, as a RESTORE would give it.

Log backups (.trn files) named by --database are always applied, whatever this variable says: see Log backups.

Syntax​

$env:FASTBCP_APPLY_SOURCEDB_LOGS = "true"

Configuration​

PropertyValue
Valuestrue or false, in any case. Any other value stops the run at startup with a message naming the variable
DefaultNot set: false
Applies to--connectiontype backup_mssql
Files in --databaseFASTBCP_APPLY_SOURCEDB_LOGSThe table is read
.bak files onlyNot set or falseAs in the full backup and its differential
.bak files onlytrueAt the end of the log the .bak files hold
With .trn filesNot set or trueAt the end of the last log backup given
With .trn filesfalseAt the end of the last log backup given, with a warning

The log is applied as one chain, from the backup read to the last log backup: with .trn files, the log the .bak files hold is part of it. To read a table without the log, leave the .trn files out of --database and this variable unset.

Example​

export FASTBCP_APPLY_SOURCEDB_LOGS=true
./FastBCP \
--connectiontype backup_mssql \
--server "/var/opt/mssql/backup" \
--database "sales_full.bak" \
--sourceschema "dbo" \
--sourcetable "orders" \
--directory "/export/orders" \
--fileoutput "orders.parquet" \
--parallelmethod "Physical" \
--paralleldegree 8

What FastBCP Logs​

At the start of each export:

Backup log : applied (adbc.arpemsbackup.restore_log=true): the tables are read as at the end of the log

or Backup log : not applied: the tables are read as in the full backup and its differential.

Good to know
  • What cannot be replayed fails the export, naming it: see Log backups.
  • Do not set it to true to read the changes of a table (adbc.arpemsbackup.read_mode): that read mode reads the log backups as they are, and is refused with the log applied.

With --sourceconnectstring​

An adbc.arpemsbackup.restore_log=true or false option in --sourceconnectstring wins over the variable and over the .trn files.

See Also​

Copyright © 2026 Architecture & Performance.