Skip to content

§ Databases · Relational

SQL Server backups, natively.

A native COPY_ONLY .bak per database — so your own backup chain is never disturbed — checked with RESTORE VERIFYONLY before it leaves the server. T-SQL travels on stdin and the password in SQLCMDPASSWORD, never on the command line.

What Xtic runs

sqlcmd (mssql-tools18)
BACKUP DATABASE [appdb] TO DISK = N'/var/opt/mssql/backup/xtic/<run>/appdb.bak' WITH COPY_ONLY, FORMAT, INIT, CHECKSUM, COMPRESSION

Shown with placeholders. Credentials never appear on a command line: they reach the tool through the environment, a file descriptor or a short-lived file in memory.

Restore paths

  • Original database: single-user, RESTORE … WITH REPLACE, back to multi-user — with approval and a safety snapshot
  • Under a new name: RESTORE with a MOVE for every logical file
  • Fresh instance: logins recreated with their SIDs and orphaned users re-linked

Verification

RESTORE VERIFYONLY … WITH CHECKSUM before collection; DBCC CHECKDB in restore drills. Every artifact is also hashed, and the stored copy is read back and compared before the run counts as verified.

Version rule

Restore to the same or a newer version only; Linux and Windows both work.

Good to know

  • COPY_ONLY by default: a regular full backup would reset the differential base of your other backups
  • Logins, SQL Agent jobs and TDE certificates are server objects — included only when you choose to
  • Staging uses the data volume, so preflight checks free space first
  • Licence and editions: Backup compression is not available on Express; ZSTD compression needs 2025 — preflight reads the edition.