Name

.backup — Perform a low-level copy of a database to file

Common Usage

.backup [database_name] filename

Description

The .backup command performs a low-level copy of an open or attached database to the provided filename. This command is safe to run against an active source database (although it may not succeed). If the database name is not provided, the main database will be backed up. This command is frequently used to write-back an active in-memory database to a database file.

This is the opposite of the .restore command.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.