Canvas Backup is a local-first Python tool for archiving Canvas LMS course shells to a folder on your computer. That folder can be a normal local folder, an external drive, or a folder that already syncs through Google Drive Desktop, Dropbox, or OneDrive.
It is designed for instructors who want to keep a reusable course library organized by:
archive-root/
year/
semester/
course-shell/
The tool preserves Canvas file folders, module order, module items, pages, assignments, quizzes, discussions, and due-date manifests.
After downloading, Canvas Backup checks downloaded Canvas files for exact duplicates, removes duplicate copies, and records the cleanup in manifests/duplicates.json. Built-in Google Drive API upload is optional.
Four commands cover almost everything.
Handy flags:
| Flag | What it does |
|---|---|
--dry-run |
Show what would download. Downloads nothing. |
--choose |
Pick from a numbered list instead of taking everything. |
--limit 2 |
Do a small test run before committing to a big one. |
--download-workers 10 |
Use more parallel downloads. Go faster. |
--json-progress |
Emit JSON Lines instead of text. For scripts, not people. archive only. |
Both diagrams also come in a softer sketch style, handy for slides or a handout: how it works and using it.
Clone the repository:
git clone https://github.com/Ryfter/canvas-backup.git
cd canvas-backupRun setup.
Windows PowerShell:
.\scripts\setup.ps1macOS/Linux:
chmod +x scripts/setup.sh
./scripts/setup.shThe setup script creates .venv, .env, config.local.toml, secrets/, and the archive folder from your config if they do not already exist.
After setup, use the launcher in the project folder. You do not need to find or run anything inside .venv.
Edit .env:
CANVAS_TOKEN=your-canvas-tokenEdit config.local.toml:
[canvas]
base_url = "https://your-school.instructure.com"
token_env = "CANVAS_TOKEN"
[archive]
root = "~/CanvasArchive"
year = "2026"
semester = "Spring"
download_workers = 6To store archives in a synced folder, change root to that local folder path, such as a Google Drive Desktop, Dropbox, or OneDrive folder.
Preview recent shells.
Windows PowerShell:
.\canvas-backup.ps1 --config config.local.toml archive-recent --years 4 --choose --dry-runmacOS/Linux:
./canvas-backup.sh --config config.local.toml archive-recent --years 4 --choose --dry-runDownload selected shells by removing --dry-run. Add --sync-drive only if you want Canvas Backup to upload through the Google Drive API after the local download finishes.
New here? Start with one of these.
- Professor Quick Start — the guided path, start to finish.
- Setup Guide — installing it, in detail.
Everyday use
- Command Reference — every command and flag.
- Configuration — what goes in
config.local.toml. - Troubleshooting — when something goes wrong.
- Updating Canvas Backup — getting the latest version.
Going further
- Technical Professor Guide — performance, manifests, recovery.
- Local And Synced Folder Backups — external drives, Dropbox, OneDrive.
- Google Drive Setup — the optional Drive API upload.
- Archive Format — exactly what lands on disk.
- Security Notes — protecting your Canvas token.
Contributing and background
- Canvas course metadata.
- Canvas file folders and files.
- Exact duplicate downloaded files are removed after download and before Drive upload.
- Modules and module items in order.
- Pages as HTML plus JSON metadata.
- Assignments as HTML plus JSON metadata.
- Due dates as JSON and CSV.
- Quizzes and discussion topics as JSON, with discussion HTML where available.
- Download reports, duplicate cleanup reports, and optional Drive sync reports.
Never commit secrets. These files are intentionally ignored:
.envconfig.local.tomlsecrets/secrets/google-client-secret.jsonsecrets/google-token.json
Local archive folders are created automatically. Google Drive API sync creates Drive folders if that optional workflow is used.
- External tool content, publisher integrations, and embedded third-party media may only be preserved as links or metadata if Canvas does not expose the underlying file through the API.
- Canvas access depends on the permissions attached to your Canvas token.
- Built-in Google Drive API sync is optional. A local Google Drive Desktop, Dropbox, or OneDrive folder may be enough for many users.

