# Backups

# Database

It is recommended to take regular backups or snapshots of your Postgres database, we recommend daily at a minimum retained for a month for the most safety. You should always take a database backup or server snapshot before upgrading between releases – each release introduces automatic database migrations and changes that are not always backwards compatible.

The specifics of backing up a Postgres database depend on your hosting situation and are not considered in scope for this guide – see the [official documentation](https://www.postgresql.org/docs/current/backup.html).

# Environment

If your hosting environment does not provide secret storage and environment variables are stored in a `.env` file then this file should be backed up after every change, for example to a password manager or other encrypted store. Losing the `SECRET_KEY` environment variable for example will result in all encrypted data in the database becoming inaccessible.

# Exporting content

Alternatively you can also create backups in HTML, Markdown, or JSON format from **Settings → Export.** These could also be automated using a script and the associated API endpoints. Documentation for this endpoint can be found here ([API documentation](https://www.getoutline.com/developers#tag/collections/POST/collections.export_all)).

---

**Documents**

- [License restrictions](https://docs.getoutline.com/s/hosting/doc/license-restrictions-f9aq6uEL3H)
- [Requirements](https://docs.getoutline.com/s/hosting/doc/requirements-ULdYnwi4wG)
- [Installation methods](https://docs.getoutline.com/s/hosting/doc/installation-methods-pSvgz9j0QC)
- [Configuration](https://docs.getoutline.com/s/hosting/doc/configuration-509J4lAzjo)
- [Business + Enterprise](https://docs.getoutline.com/s/hosting/doc/business-enterprise-rv0715NxO3)
- [Backups](https://docs.getoutline.com/s/hosting/doc/backups-KZtPOADCHG)
- [Troubleshooting](https://docs.getoutline.com/s/hosting/doc/troubleshooting-HXckrzCqDJ)