Copy-Only Backups (SQL Server)

A copy-only backup is a SQL Server backup that is taken independently of the normal sequence of conventional backups. A copy-only backup is always a full backup, regardless of the backup type of the conventional backup that precedes it (full, differential, or log).

Copy-only backups are used to create a backup that does not interfere with the regular backup routine of the database. This is useful in situations where you want to back up a database for a special purpose, such as for a disaster recovery test or for a temporary purpose, without affecting the backup chain.

When to Use Copy-Only Backups

Features and Benefits

Syntax for Copy-Only Backups

You can create a copy-only backup using SQL Server Management Studio (SSMS) or Transact-SQL (T-SQL).

Using Transact-SQL (T-SQL)

To create a copy-only full backup:

BACKUP DATABASE [YourDatabaseName]
TO DISK = 'C:\Backup\YourDatabaseName_CopyOnly_Full.bak'
WITH COPY_ONLY, NOINIT, NOUNLOAD, NAME = N'YourDatabaseName-Copy-Only Full Backup', STATS = 10;
GO

To create a copy-only differential backup (note: copy-only backups are always full by nature of their definition, this syntax will create a full backup marked as copy-only):

-- A copy-only backup is always a full backup and does not affect the differential base.
-- The following command effectively creates a full copy-only backup.
BACKUP DATABASE [YourDatabaseName]
TO DISK = 'C:\Backup\YourDatabaseName_CopyOnly_Full.bak'
WITH COPY_ONLY, NOINIT, NOUNLOAD, NAME = N'YourDatabaseName-Copy-Only Backup', STATS = 10;
GO

Using SQL Server Management Studio (SSMS)

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine.
  2. Expand the Databases node.
  3. Right-click the database that you want to back up.
  4. Point to Tasks, and then click Back Up....
  5. In the Back Up Database dialog box, select Full as the backup type.
  6. Under Backup Options, select the Copy-only backup checkbox.
  7. Click OK to create the backup.

Understanding the Impact on Backup Chains

Conventional backups follow a sequence:

A copy-only backup does not participate in this chain. It acts as a standalone snapshot:

Scenario Example

Consider the following backup sequence:

  1. Full Backup (F1): Taken on Monday. This is the base for differentials.
  2. Copy-Only Full Backup (C1): Taken on Tuesday. Does NOT affect F1.
  3. Differential Backup (D1): Taken on Wednesday. This is based on F1, NOT C1.
  4. Transaction Log Backup (L1): Taken on Thursday. This is based on D1.

If you need to restore, you would restore F1, then D1, then L1. C1 can be restored independently if needed.

Considerations