Upgrading
Upgrade Teldrive with a database backup, validation, smoke tests, and rollback path.
Startup can run Teldrive, River, and RiverPro migrations. Back up PostgreSQL before the new version initializes.
Before upgrading
Migrating from v1
Legacy bots with a zero ID have their ID recovered from the numeric prefix of
their BotFather token (bot_id:secret). Tokens are preserved and encrypted with
the v2 security.data-key; no Telegram login is needed for this recovery.
Migration preserves existing bots as enabled but does not reconfigure their Telegram channel permissions. After logging in, open Settings → Telegram bots and choose Provision on a bot to verify its token and repair its access to your registered channels. Follow the task in Tasks. Telegram can temporarily restrict admin changes after a fresh login; the task retries these restrictions every hour, for up to 48 hours.
Upgrade checklist
- Read release notes.
- Record the current version.
- Back up PostgreSQL.
- Verify you still have
security.data-keyand content-encryption keys. - Keep the previous image/binary available.
Use a pinned release tag:
image: ghcr.io/tgdrive/teldrive:X.Y.ZCompose
docker compose pull teldrive
docker compose run --rm teldrive check
docker compose up -d teldrive
docker compose logs --tail=250 teldrivecheck can run migrations, so the backup must exist before it.
Binary install
Keep old and new binaries side by side:
/usr/local/lib/teldrive/teldrive-OLD
/usr/local/lib/teldrive/teldrive-X.Y.ZValidate before switching:
/usr/local/lib/teldrive/teldrive-X.Y.Z check --config /etc/teldrive/config.tomlSmoke test
Verify:
/health/liveand/health/ready;- login/session refresh;
- listing, upload, download, rename/move/trash/restore;
- tasks;
- shares, rclone, and bots if used.
Rollback
An older binary may not work against a newer migrated schema. A full rollback may require:
- stop the new version;
- restore the pre-upgrade PostgreSQL backup;
- restore the previous binary/image and matching configuration;
- run
teldrive checkbefore serving traffic.
For multi-instance deployments, coordinate the rollout and avoid unsupported mixed-version operation.
See Backup and restore.