Copy-Only Backups (SQL Server)

APPLIES TO: yesSQL Server yesAzure SQL Database (Managed Instance only) noAzure SQL Data Warehouse noParallel Data Warehouse

A copy-only backup is a SQL Server backup that is independent of the sequence of conventional SQL Server backups. Usually, taking a backup changes the database and affects how later backups are restored. However, occasionally, it is useful to take a backup for a special purpose without affecting the overall backup and restore procedures for the database. Copy-only backups serve this purpose.

The types of copy-only backups are as follows:

  • Copy-only full backups (all recovery models)

    A copy-only backup cannot serve as a differential base or differential backup and does not affect the differential base.

    Restoring a copy-only full backup is the same as restoring any other full backup.

  • Copy-only log backups (full recovery model and bulk-logged recovery model only)

    A copy-only log backup preserves the existing log archive point and, therefore, does not affect the sequencing of regular log backups. Copy-only log backups are typically unnecessary. Instead, you can create a new routine log backup (using WITH NORECOVERY) and use that backup together with any previous log backups that are required for the restore sequence. However, a copy-only log backup can sometimes be useful for performing an online restore. For an example of this, see Example: Online Restore of a Read-Write File (Full Recovery Model).

    The transaction log is never truncated after a copy-only backup.

Copy-only backups are recorded in the is_copy_only column of the backupset table.

To Create a Copy-Only Backup

You can create a copy-only backup by using SQL Server Management Studio, Transact-SQL, or PowerShell.


A. Using SQL Server Management Studio

In this example, a copy-only backup of the Sales database will be backed up to disk at the default backup location.

We are listening: If you find something outdated or incorrect in this article, such as a step or a code example, please tell us. You can click the This page button in the Feedback section at the bottom of this page. We read every item of feedback about SQL, typically the next day. Thanks.

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance.

  2. Expand Databases, right-click Sales, point to Tasks, and then click Back Up....

  3. On the General page in the Source section check the Copy-only backup checkbox.

  4. Click OK.

B. Using Transact-SQL

This example creates a copy-only backup for the Sales database utilizing the COPY_ONLY parameter. A copy-only backup of the transaction log is taken as well.

TO DISK = 'E:\BAK\Sales_Copy.bak'

TO DISK = 'E:\BAK\Sales_LogCopy.trn'


COPY_ONLY has no effect when specified with the DIFFERENTIAL option.

C. Using PowerShell

This example creates a copy-only backup for the Sales database utilizing the -CopyOnly parameter.

Backup-SqlDatabase -ServerInstance 'SalesServer' -Database 'Sales' -BackupFile 'E:\BAK\Sales_Copy.bak' -CopyOnly

Related Tasks

To create a full or log backup

To view copy-only backups

To set up and use the SQL Server PowerShell provider

See Also

Backup Overview (SQL Server)
Recovery Models (SQL Server)
Copy Databases with Backup and Restore
Restore and Recovery Overview (SQL Server)
BACKUP (Transact-SQL)