> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/jp/endpoint-privilege-manager/user-guides/backup-and-restore.md).

# バックアップと復元

<figure><img src="/files/oL6nhK4GtntZ7ml1FKFx" alt=""><figcaption></figcaption></figure>

本ページでは、バックアップ対象、手順、復元方法、環境でのバックアップ自動化を取り扱います。アップグレード前、エージェントの新ハードウェアへの移行時、標準的な災害復旧計画の一項として、定期的なバックアップは重要です。

## バックアップ対象 <a href="#what-to-back-up" id="what-to-back-up"></a>

KEPMの完全なバックアップには4つのコンポーネントがあります。

{% stepper %}
{% step %}
**ポリシー**

多くの展開で最も重要な項目です。ローカル展開ポリシーファイルを含む `policies/` フォルダと、サーバー同期ポリシーを含む完全なアクティブ前処理済みポリシー状態を記録した `currentPolicies.json` エクスポートが対象です。
{% endstep %}

{% step %}
**構成**

`appsettings.json`、すべてのプラグイン構成ファイル (`Plugins/*.json`)、すべてのジョブ構成ファイル (`Jobs/*.json`) です。エージェントの動作を定義するため、構成変更のたびに保持してください。
{% endstep %}

{% step %}
**ストレージ**

エージェントの登録状態、統合ストレージデータ、プラグイン固有の状態を含む `KeeperStorage/` ディレクトリです。このディレクトリを失うと、復元後にエージェントの再登録が必要になります。
{% endstep %}

{% step %}
**証明書**

カスタム証明書を使用する場合 (デフォルトの自動生成自己署名証明書ではなく)、証明書ファイルを含めるか、KEPM証明書に対応するWindows証明書ストアのエントリを文書化してください。
{% endstep %}
{% endstepper %}

## バックアップの場所 <a href="#backup-locations" id="backup-locations"></a>

<table data-header-hidden="false" data-header-sticky><thead><tr><th width="119.66668701171875">プラットフォーム</th><th width="302.6666259765625">インストールディレクトリ</th><th>ストレージディレクトリ</th></tr></thead><tbody><tr><td>Windows</td><td><code>C:\Program Files\Keeper Security\Endpoint Privilege Management\</code></td><td><code>...\KeeperStorage\</code></td></tr><tr><td>Linux</td><td><code>/opt/keeper/sbin/</code></td><td><code>/opt/keeper/sbin/KeeperStorage/</code></td></tr><tr><td>macOS</td><td><code>/Library/Keeper/sbin/</code></td><td><code>/Library/Keeper/sbin/KeeperStorage/</code></td></tr></tbody></table>

## 手動バックアップの取得 <a href="#taking-a-manual-backup" id="taking-a-manual-backup"></a>

ストレージファイルを一貫した状態にするため、ファイルシステムバックアップの前に必ずサービスを停止してください。

### **Windows:**

powershell

```powershell
# Stop the service
Stop-Service -Name "KeeperPrivilegeManager"

# Back up the full installation directory
xcopy "C:\Program Files\Keeper Security\Endpoint Privilege Management" `
      "C:\Backup\KEPM\$(Get-Date -Format 'yyyyMMdd')" /E /I /H /Y

# Restart the service
Start-Service -Name "KeeperPrivilegeManager"
```

### **Linux:**

bash

```bash
sudo systemctl stop keeper-privilege-manager
sudo tar -czf "/backup/keeper-backup-$(date +%Y%m%d).tar.gz" /opt/keeper/sbin/
sudo systemctl start keeper-privilege-manager
```

### **macOS:**

bash

```bash
sudo launchctl stop com.keeper.privilegemanager
sudo tar -czf "$HOME/backup/keeper-backup-$(date +%Y%m%d).tar.gz" /Library/Keeper/sbin/
sudo launchctl start com.keeper.privilegemanager
```

## バックアップからの復元 <a href="#restoring-from-a-backup" id="restoring-from-a-backup"></a>

#### **完全復元 (新マシンまたは完全障害):**

1. バックアップを作成したのと同じバージョンのKEPMをインストールします。アップグレードガイドを確認せずに、新しいまたは古いバージョンへバックアップを復元しないでください。
2. サービスが実行中の場合は停止します。
3. バックアップをインストールディレクトリへ復元します。

bash

```bash
# Linux example
sudo systemctl stop keeper-privilege-manager
sudo tar -xzf /backup/keeper-backup-YYYYMMDD.tar.gz -C /
sudo systemctl start keeper-privilege-manager
```

4. サービス起動後、正常性を確認します。

bash

```bash
curl -sk https://localhost:6889/health
curl -sk https://localhost:6889/api/Keeper/registration
```

5. 登録状態が `true` であること、ポリシーが読み込まれていることを確認します。

#### **ポリシーのみ (登録に影響せずポリシー構成を復元):**

1. ポリシーJSONファイルを `policies/` フォルダにコピーします。
2. KeeperPolicyプラグインがファイル変更を検出し、ポリシーを自動的に再読み込みします。サービスの再起動は不要です。
3. `currentPolicies.json` を確認するか、ポリシーの動作を観察して、アクティブなポリシー状態を確認します。

#### **構成のみ:**

1. サービスを停止します。
2. 対象の構成ファイルを置き換えます。
3. サービスを開始します。
4. 影響を受けるプラグインが実行中であることを確認します。

## バックアップの自動化 <a href="#automating-backups" id="automating-backups"></a>

### **Windowsタスクスケジューラ:**

powershell

```powershell
$action = New-ScheduledTaskAction `
  -Execute "powershell.exe" `
  -Argument "-File C:\Scripts\backup-keeper.ps1"
$trigger = New-ScheduledTaskTrigger -Daily -At 2am
Register-ScheduledTask `
  -TaskName "KEPM-Daily-Backup" `
  -Action $action `
  -Trigger $trigger `
  -RunLevel Highest
```

### **Linux cron:**

bash

```bash
# Add to root crontab: crontab -e
0 2 * * * /opt/scripts/backup-keeper.sh
```

#### **Linuxバックアップスクリプトの例:**

bash

```bash
#!/bin/bash
BACKUP_DIR="/backup/keeper"
DATE=$(date +%Y%m%d)
KEEP_DAYS=30

# Create backup
systemctl stop keeper-privilege-manager
tar -czf "$BACKUP_DIR/keeper-backup-$DATE.tar.gz" /opt/keeper/sbin/
systemctl start keeper-privilege-manager

# Remove backups older than KEEP_DAYS
find "$BACKUP_DIR" -name "keeper-backup-*.tar.gz" -mtime +$KEEP_DAYS -delete
```

***

## 災害復旧チェックリスト <a href="#disaster-recovery-checklist" id="disaster-recovery-checklist"></a>

新規または再構築したマシンでKEPMを復旧する際は、以下のチェックリストを使用してください。

* [ ] バックアップと同じKEPMバージョンをインストール
* [ ] 完全バックアップアーカイブをインストールパスへ復元
* [ ] ファイルの所有権と権限が[セキュリティ強化](/keeperpam/jp/endpoint-privilege-manager/user-guides/security-hardening.md)ガイドの要件と一致していることを確認
* [ ] サービスを開始し、正常状態に到達することを確認
* [ ] エージェントが登録済みであることを確認 (`"IsRegistered": true`)
* [ ] KeeperAPIおよびKeeperPolicyプラグインがRunningであることを確認
* [ ] アクティブなポリシーが読み込まれていることを確認 (`currentPolicies.json` を確認)
* [ ] 少なくとも1つの制御されたアクションでポリシー評価をテスト
* [ ] 復旧日と元の構成との差異を文書化

**四半期ごとに復旧手順をテストしてください。** 一度もテストされていないバックアップは、信頼できるバックアップとは言えません。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.keeper.io/keeperpam/jp/endpoint-privilege-manager/user-guides/backup-and-restore.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.
