# バックアップ

定期的なバックアップは、Chamiloのデータを保護するために不可欠です。このページでは、バックアップすべき内容とその方法について説明します。

## バックアップ対象

### 1. データベース

Chamiloのデータベースには、プラットフォームのすべてのデータが含まれています：ユーザー、コース、追跡情報、成績、メッセージ、設定など。これが最も重要なバックアップ対象です。

**バックアップ方法：**

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

### 2. ファイル

Chamiloはアップロードされたファイル（ドキュメント、画像、SCORMパッケージ）をファイルシステムに保存します。バックアップすべき主要なディレクトリは以下の通りです：

* `var/` — アップロードされたファイルとリソース
* `public/plugin/` — プラグインファイル（カスタムプラグインを追加した場合のみ）

クラウドストレージ（S3、Azure Blob）を使用している場合は、クラウドプロバイダのバックアップ/バージョン管理が有効になっていることを確認してください。

### 3. 設定

* `.env` — 環境設定ファイル
* `config/` — カスタム設定ファイル

## バックアップスケジュール

| コンポーネント | 推奨頻度                  |
| ------- | --------------------- |
| データベース  | 毎日                    |
| ファイル    | 毎日または毎週（アップロードの頻度による） |
| 設定      | 設定変更後                 |

## 復元

バックアップから復元する手順：

1. SQLダンプからデータベースを復元する
2. ファイルディレクトリを復元する
3. 設定ファイルを復元する
4. Symfonyのキャッシュをクリアする：`php bin/console cache:clear`

## ヒント

* **バックアップの自動化** — cronジョブを使用してバックアップを自動的に実行する
* **オフサイト保存** — バックアップのコピーを別のサーバーまたはクラウドストレージに保存する
* **復元テスト** — 定期的にバックアップから正常に復元できるかテストする
* **プロセスの文書化** — 復元プロセスの手順を書面で残し、チームの誰でも実行できるようにする


---

# 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/2.x-ja/gaido-1/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.
