# Backup and Restore

**Backup and Restore** allows you to create backups of configurations for the LPSM and restore these configurations when required. You can download or upload the backup files to a different machine using SFTP (SSH File Transfer Protocol). You can also use any SFTP client to download and upload the backup files.

<div align="left"><figure><img src="https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FAVSoGXkP6ZUhSU5k9ANK%2Fimage.png?alt=media&#x26;token=9be5e092-f195-4eb3-a37e-7309bbff7917" alt="" width="375"><figcaption><p>Backup and Restore</p></figcaption></figure></div>

<details>

<summary>Create a Backup</summary>

1. Go to `Settings >> System >> Backup and Restore >> Backup Archive`.\
   ![Backup and Restore Page](https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FeUi1obPFgBZke6KOwijS%2Fimage.png?alt=media\&token=b1547831-8b39-4a8d-b565-9565aa53726a)
2. Click **Backup Now**.\
   ![Backup Name Pop-up Panel](https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FDwsyFBGkPtLvqYD7wvOg%2Fimage.png?alt=media\&token=453bd7ab-8f96-4e85-b133-ad73c63b2de1)
3. Enter the **Backup Name** and click **OK**.\
   ![List of Backups Created](https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FgfHAvTQlT51MwE1aERTC%2Fimage.png?alt=media\&token=e230f728-6c28-4903-8e98-1880b0983ea1)

</details>

<details>

<summary>Configure Backup Settings</summary>

1. Go to `Settings >> System >> Backup and Restore >> Backup Settings`.\
   ![Backup Settings](https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2F9xoGTliSv9f9Dk4ZuBk0%2Fimage.png?alt=media\&token=e6933ab3-b8d3-46e4-98d3-b05cd315fa2b)
2. Enter the **Public Key** of the SSH key pair.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Save the <strong>Public Key</strong>. You can use the private key of the SSH key pair to access the backup files using SFTP (SSH File Transfer Protocol).</p></div>
3. Select the **Schedule Backup** checkbox to schedule backups.
4. Select the **Interval** of the backup.
5. Select the **Backup Run Hour** in UTC. LPSM takes backups on the specified run hour at regular intervals.
6. Select the **Backup Retention** period in days. LPSM deletes the backups after the specified number of days from the date of creation.
7. Click **Save**.

LPSM also populates the scheduled backups in the **Backup Archive** list.

</details>

<details>

<summary>Restore a Backup</summary>

1. Go to `Settings >> System >> Backup and Restore >> Backup Archive`.
2. Click the **Restore** (<img src="https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FMQam6dw6yrBuJQs9I5iX%2Fimage.png?alt=media&#x26;token=928412cc-5490-439b-8926-75b30d0039db" alt="" data-size="line">) icon from the **Actions** column to restore a backup.
3. Click **Yes**.

</details>

<details>

<summary>Delete a Backup</summary>

1. Go to `Settings >> System >> Backup and Restore >> Backup Archive`.
2. Click the **Delete** (<img src="https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FH0OtcrFPxEpRuwfB2QGd%2Fimage.png?alt=media&#x26;token=9f322c23-5b10-4968-9e67-ca6bdeabe015" alt="" data-size="line">) icon from the **Actions** column for the backup.
3. Click **Yes**.

</details>

<details>

<summary>Transfer Backups</summary>

You can transfer the backup files between LPSM and an external device using SFTP. To transfer the files:

1. Generate a public SSH key on the device where you want to transfer the backup files.
2. In LPSM, go to `Settings >> System >> Backup and Restore >> Backup Settings` from the navigation bar.
3. Copy the public SSH key and paste it into **Public Key**.\
   ![Public key in Backup and Restore](https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FNXMu1nMSjpasUYWrEzLC%2Fimage.png?alt=media\&token=2c0da84c-8f89-46e4-9db0-53ceb2ad394a)

{% hint style="info" %}
You need to copy the public SSH key only once per LPSM.
{% endhint %}

4. Go back to the external device and make an SFTP connection to the LPSM server as the **loginspect** user.

   ```
   sftp loginspect@<IP address of LPSM server>
   ```

   ![SFTP connection to a LPSM](https://3198401301-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhzE0kPDYI002AO7fHbFv%2Fuploads%2FR6c8moOKtf1Bqvi8PfVB%2Fimage.png?alt=media\&token=a3d6a9bf-9e2a-48f9-8a2a-e5677ce40382)
5. Verify the current folder in the local machine using the **lpwd** command. You can switch folders using **lcd**.
6. Use the **get -r** SFTP command to download the backup folder recursively to the current local folder.

   ```
   cd configuration/zipped
   get -r <backup folder name>
   ```

{% hint style="info" %}

* You can use the **put -r** command to transfer the backup folder to LPSM.
* The configuration backup folder is stored inside `configuration >> zipped`.
  {% endhint %}

</details>
