Browse documentation

Back up and restore deployment files

Take a file backup before a risky change, select the right restore point, and check the application after recovery.

Capture the files you need

Source control records the files you commit. A bot can also create state while it runs, such as the Telegram starter’s recent update IDs or files uploaded by a user. Identify which deployment files you would need to restart with that state intact. If the application writes several related files at once, stop it at a clean point before taking the backup.

On a deployment with backups enabled, open Backups and check the slot allowance. Select Back up now. Wait until the entry finishes and has a Restore action before changing files. Note the backup time and the running commit. Common dependency caches, virtual environments and log files are excluded, so keep the manifest and lockfile needed to reinstall dependencies.

Confirm the restore point

Download a separate copy of any newer files you still need. A restore replaces deployment files and stops a running process during recovery. Open Backups, find the successful entry for the desired time, and select Restore. On the confirmation page, check the deployment name and timestamp before typing the name and confirming.

The backup covers files. Credentials and Variables are managed separately. If your start command, entry path or provider credential changed since the backup, review those settings before exercising the restored code. Also review your GitHub checkout settings. A restart with automatic updates enabled can fetch a newer branch revision.

Test the recovered application

A previously running deployment is started again after a successful restore. If you stopped it for the operation, start it when ready. Open a representative restored file, inspect Console and repeat a product-specific check, such as a private bot command or an HTTPS request to a known route. For a scheduled script, check its next UTC occurrence and inspect the next run result.

If backups are unavailable or the restore outcome is unclear, inspect the backup list and activity history before retrying. For help, include the deployment name, backup time and relevant status message. Get deployment support.