> For the complete documentation index, see [llms.txt](https://docs.platform9.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform9.com/self-managed-cloud-platform/sso-configuration/etcd-restore.md).

# Etcd Restore

The Airctl Etcd restore process is essential for restoring the etcd database to a previous state captured in the backup .

{% hint style="warning" %}
**Warning**

The Airctl Etcd restore feature is added assuming volumes attached at the time of taking backups are in place and intact or preserved by customers by using external support .

Manually copy Etcd backup file on each node at `/opt/pf9/pf9-kube/etcd-restore/etcd-backup.db`
{% endhint %}

## Command Syntax

The Etcd restore command in Airctl follows a specific syntax:

{% tabs %}
{% tab title="None" %}

```none
airctl mgmt-etcd-restore --config airctl-config.yaml --verbose
```

{% endtab %}
{% endtabs %}

* `--config airctl-config.yaml`: References the Airctl configuration file, ensuring alignment with the required configurations during restoration.

## Detailed Restore Process

### Purpose

The restore process aims to replace current Etcd database from a previously captured Etcd snapshot.

### Steps Involved

1. **Command Invocation**
   * Copy etcd backup file manually to each master node at `/opt/pf9/pf9-kube/etcd-restore/etcd-backup.db.` `Required`
   * Execute the `airctl mgmt-etcd-restore` command.
   * Use the `--config` flag to reference the `airctl-config.yaml` file, ensuring the restoration aligns with the necessary configurations.
   * Wait for etcd to stablize , check etcd status and member list using below command :
     * `/opt/pf9/pf9-kube/bin/etcdctl endpoint status -w table`
     * `/opt/pf9/pf9-kube/bin/etcdctl member list -w table`
   * perform nodelet phases restart on each node by following below steps:
     * `systemctl stop pf9-nodeletd.service`
     * `/opt/pf9/nodelet/nodeletd phases restart`
2. **Backup Source**
   * The Etcd restore command triggers `/opt/pf9/pf9-kube/etcd-restore/etcd-restore.sh` script shipped via `pf9-kube` package on each node which uses `etcd-backup.db` file copied by user on each master node under dir `/opt/pf9/pf9-kube/etcd-restore/` .
3. **Restoration Process**
   * The restoration process uses etcd.env to get ENV variables required to restore etcd cluster .

### Usage Example:

#### Restore Etcd command :

{% tabs %}
{% tab title="None" %}

```none
airctl mgmt-etcd-restore --config airctl-config.yaml --verbose
```

{% endtab %}
{% endtabs %}

#### Check Etcd status and member list on each node :

{% tabs %}
{% tab title="None" %}

```none
/opt/pf9/pf9-kube/bin/etcdctl endpoint status   -w table
/opt/pf9/pf9-kube/bin/etcdctl member list   -w table
```

{% endtab %}
{% endtabs %}

#### Perform nodelet phases restart :

{% tabs %}
{% tab title="None" %}

```none
systemctl stop pf9-nodeletd.service
/opt/pf9/nodelet/nodeletd phases restart
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Info**

Nodelet phases restart may take 15-20 mins
{% endhint %}


---

# 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.platform9.com/self-managed-cloud-platform/sso-configuration/etcd-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.
