# Backups

Regular backups are essential for protecting your Chamilo data. This page covers what to back up and how.

## What to Back Up

### 1. Database

The Chamilo database contains all platform data: users, courses, tracking, grades, messages, and settings. This is the most critical component to back up.

**How to back up:**

```bash
mysqldump -u username -p chamilo_database > chamilo_backup_$(date +%Y%m%d).sql
```

### 2. Files

Chamilo stores uploaded files (documents, images, SCORM packages) in the filesystem. The key directories to back up:

* `var/` — Uploaded files and resources
* `public/plugin/` — Plugin files (only if you have added custom plugins)

If you use cloud storage (S3, Azure Blob), ensure your cloud provider's backup/versioning is enabled.

### 3. Configuration

* `.env` — Your environment configuration
* `config/` — Any custom configuration files

## Backup Schedule

| Component     | Recommended frequency                          |
| ------------- | ---------------------------------------------- |
| Database      | Daily                                          |
| Files         | Daily or weekly (depending on upload activity) |
| Configuration | After any configuration change                 |

## Restoration

To restore from a backup:

1. Restore the database from the SQL dump
2. Restore the file directories
3. Restore the configuration files
4. Clear the Symfony cache: `php bin/console cache:clear`

## Tips

* **Automate backups** — Use cron jobs to run backups automatically
* **Store off-site** — Keep backup copies on a separate server or cloud storage
* **Test restoration** — Periodically test that you can restore from a backup successfully
* **Document your process** — Keep written instructions for the restoration process so anyone on the team can perform it


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chamilo.org/administration-guide/admin-guide/maintenance/backups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
