.TRN

TRN File

Microsoft SQL Server Transaction Log Backup
Ask a question
QUICK ANSWER

A TRN file is a Microsoft SQL Server transaction log backup. You cannot open it as a document - it is applied to SQL Server using the RESTORE LOG command or SQL Server Management Studio. To restore one you first need the preceding full backup (.bak) and any differential backups in the chain.

Developer: Microsoft Corporation Category: Backup Files MIME: application/octet-stream
OPENS ON Windows
Related: .BUP · .BAK · .SKB · .SET

On this page

19k+ extensions indexed
Last reviewed Jul 13, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the TRN file format?

A .trn file is a Microsoft SQL Server transaction log backup - a binary backup of all changes recorded in the database transaction log since the previous log or full backup. Log backups are created with the BACKUP LOG T-SQL statement or through SQL Server Management Studio (SSMS).

Despite having a dedicated extension, .trn files use the same underlying container as full backup .bak files: the Microsoft Tape Format (MTF), identifiable by the four-byte magic TAPE (hex 54 41 50 45) at the start of the file. The .trn extension is a widely adopted naming convention, not a format requirement - SQL Server accepts any extension, and many organizations use .bak for all backup types.

Transaction log backups are only available when the database uses the FULL or BULK_LOGGED recovery model. Databases on the SIMPLE recovery model cannot produce them. A point-in-time restore chain requires: a full backup → optionally one or more differential backups → a sequence of .trn log backups applied in Log Sequence Number (LSN) order.

SQL Server 2008 introduced optional backup compression (BACKUP WITH COMPRESSION), significantly reducing file sizes on busy systems. SQL Server 2014 added backup encryption using certificates or asymmetric keys. File size ranges from under 1 MB on quiet databases to hundreds of gigabytes on high-transaction-volume systems.

The format evolves with each SQL Server release and a .trn file cannot be restored to an older server version than the one that created it. Since SQL Server 2017, the format is also supported on Linux.

Security & safety

RISK: MEDIUM

TRN files contain a complete record of all database transactions including the actual data values (INSERT/UPDATE contents). If a database contains PII, sensitive financial data, or secrets, a leaked .trn file exposes all of it. Store and transmit log backups with the same security controls as the database itself. SQL Server 2014+ supports backup-level encryption with a server certificate.

Format details

in a nutshell
FULL NAMEMicrosoft SQL Server Transaction Log Backupaka SQL Server log backup, T-log backup
DEVELOPERMicrosoft Corporationsince ~1993 (SQL Server 6.0 era; .trn as convention established in SQL Server 7.0, 1998)
CATEGORYBackup Files
MIME TYPEapplication/octet-stream
TYPEproprietary binary SQL Server backup file
This extension is also used by…
  • Training data file (various apps) - Some simulation, language tool, and game software use .trn for training/localization data; unrelated to SQL Server.
  • Translation/Locale File - Some software (Ulead, older CAD tools) uses .trn for translation or locale strings.
MAGIC BYTES · FILE SIGNATURE
OFFSET
00010203
HEX
54415045
ASCII
TAPE
SQL Server backup files (both .bak and .trn) use the Microsoft Tape Format (MTF), originally designed for tape devices. The first 4 bytes spell "TAPE" (54 41 50 45). Some tools report an alternative "MSSQLBAK" string further in the file, but the true header magic is "TAPE" at offset 0. The same magic bytes appear in .bak files; the .trn extension is a naming convention only, not a distinct file format.

Programs that open TRN files

Windows2 apps
Microsoft SQL Server (SSMS) Paid In SSMS: right-click database → Tasks → Restore → Transaction Log → add the .trn file. Or T-SQL: RESTORE LOG [dbname] FROM DISK = 'path\file.trn' WITH NORECOVERY.
SQL Server Management Studio (SSMS) Free Tasks → Restore → Transaction Log; or run T-SQL RESTORE LOG command in a query window.

Technical details

deep spec
Container formatMicrosoft Tape Format (MTF) - same binary container used by `.bak` full backups
Magic bytes at offset 0`TAPE` (hex 54 41 50 45) - original MTF tape device header signature
Recovery model requirementFULL or BULK_LOGGED databases only; SIMPLE recovery model databases cannot produce log backups
LSN chainEach backup covers a Log Sequence Number (LSN) range; log backups must be applied in strict LSN order during restore
CompressionOptional via `BACKUP WITH COMPRESSION` (SQL Server 2008+); no compression by default
EncryptionOptional certificate- or asymmetric key-based encryption (SQL Server 2014+); inherits Transparent Data Encryption if enabled
Typical file size1 MB - 100 GB+ depending on transaction volume since the previous log backup
Version stampBackup header embeds the originating SQL Server version; restore to an older server version is blocked
Integrity verificationOptional `WITH CHECKSUM` during backup; verifiable offline with `RESTORE VERIFYONLY`
Restore chainFull backup → optional differential backups → sequential `.trn` log backups in LSN order
Extension convention`.trn` is a naming convention only; SQL Server enforces no specific extension - many shops use `.bak` for all backup types
Platform supportWindows (native); Linux supported via SQL Server on Linux (SQL Server 2017+)
Released~1993 (SQL Server 6.0 era; .trn as convention established in SQL Server 7.0, 1998)
Latest versionCompatible with SQL Server 2022 (current); format evolves with SQL Server versions
Specificationlearn.microsoft.com

TRN conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with TRN files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about TRN files.

Frequently asked questions

How do I open a TRN file?
TRN files are not meant to be 'opened' - they are applied to SQL Server via RESTORE LOG command. Use SQL Server Management Studio or T-SQL. You cannot read them as documents.
What is the difference between a .bak and a .trn file?
.bak typically holds a full or differential backup; .trn holds a transaction log backup. Both use the same Microsoft Tape Format; the extension is just a naming convention.
How do I restore a .trn file?
First restore the full backup WITH NORECOVERY, then any differential backups WITH NORECOVERY, then each .trn file in sequence WITH NORECOVERY, and finally bring the database online WITH RECOVERY on the last step.
Can I view the contents of a TRN file?
You can use the T-SQL function fn_dump_dblog() or third-party tools (ApexSQL Log, SQL Log Rescue) to read the transaction log records inside a .trn file for auditing or forensics.
What recovery model is required for .trn backups?
FULL or BULK_LOGGED recovery model. Databases set to SIMPLE recovery model do not support transaction log backups.
Can I delete old TRN files?
Only if you have verified the backup chain is intact and you no longer need point-in-time recovery to those dates. Breaking the chain makes all subsequent .trn files in that chain unusable.

References

1Microsoft Docs - Transaction Log Backups (SQL Server)learn.microsoft.com
2Microsoft Docs - RESTORE LOG (T-SQL)learn.microsoft.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.NOMEDIAAndroid No-Media Marker File
7.RPMSGRestricted Permission Message
8.MDMarkdown Document
9.TMPTemporary File
10.BINCD/DVD Disc Image (BIN/CUE)

Related extensions

.BUPDVD IFO Backup File
.BAKBackup File (generic)
.SKBSketchUp Backup File
.SETMicrosoft Backup File Set
.BAK~AbiWord auto-saved document file
.BACKUPBackup File (generic)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z