Create a backup from inside sqlite3.

Section: Backup and maintenance

Use the shell backup command

text
text
.backup backup.db
Explanation

A convenient shell-level backup path for local workflows.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Backup and maintenance
Create a compact backup with VACUUM INTO
Write a fresh copy of the database to a new file.
OpenIn sheetsqlsame section
Run VACUUM
Rebuild the database file and reclaim free space.
OpenIn sheetsqlsame section
Run an integrity check
Verify the database structure and content consistency.
OpenIn sheetsqlsame section
Import CSV with mode and separator
Set shell parsing options before import.
OpenIn sheettext1 tag match
Export a query result to CSV
Write selected rows to a CSV file.
OpenIn sheettext1 tag match
Dump one table
Export only selected table schema and data.
OpenIn sheettext1 tag match