Backup & Restore
TorrPlay provides backup and restore endpoints for exporting and importing your entire torrent library — including metadata, categories, poster images, and torrent info hashes — across instances or before upgrades.
Downloading a Backup
GET /api/v1/torrents/backupReturns a JSON file containing all torrent metadata (hashes, magnet links, names, categories, and posters). Application settings are not included. Save it to disk:
curl -o torrplay.backup http://localhost:8090/api/v1/torrents/backupRestoring from a Backup
POST /api/v1/torrents/restoreUpload the backup file using multipart/form-data:
curl -X POST http://localhost:8090/api/v1/torrents/restore \
-F "file=@torrplay.backup"TorrPlay will re-add all torrents from the backup with their original metadata.
Updating a Backup with Metadata
Before restoring, you can update the backup file by fetching fresh metadata (poster images, titles, categories) from external providers using the metadata CLI subcommand.
Available Flags
| Flag | Description | Default |
|---|---|---|
--backup <path> | Input backup file | torrplay.backup |
--output <path> | Output file path | <input>.updated |
--category | Update categories (Movies / Series) | Disabled |
--poster | Fetch and update poster images | Disabled |
--title | Update titles from provider | Disabled |
--language <lang> | 3-letter language code (eng, spa, rus, …) | — |
--provider <name> | Metadata provider (currently tvdb only) | tvdb |
--api-key <key> | API key for the chosen provider | — |
Note:
--api-keyis required when--posteror--titleis used.
Example
Fetch posters and titles from TheTVDB in English:
./torrplay metadata \
--backup torrplay.backup \
--poster --title \
--language eng \
--provider tvdb \
--api-key YOUR_TVDB_API_KEYThis produces torrplay.backup.updated. Specify --output to choose a custom output path.
Full Migration Workflow
graph LR
Inst1["Source TorrPlay Instance"] -->|1. GET /api/v1/torrents/backup| File["torrplay.backup"]
File -->|2. Add Metadata: ./torrplay metadata| Updated["torrplay.backup.updated"]
Updated -->|3. POST /api/v1/torrents/restore| Inst2["Target TorrPlay Instance"]
# 1. Download backup from the source instance
curl -o torrplay.backup http://source-host:8090/api/v1/torrents/backup
# 2. (Optional) Update with metadata
./torrplay metadata --backup torrplay.backup --poster --title --provider tvdb --api-key KEY
# 3. Restore to the target instance
curl -X POST http://target-host:8090/api/v1/torrents/restore \
-F "file=@torrplay.backup.updated"