# Backup

{% hint style="danger" %}
**Note**: In version **2020.2.XXX**, the backup functionality has been moved to a separate module and is not included in the core package. The module can be installed via the [Module Management section](broken://pages/meuGOnb4IGFsWJ0CdCrB).
{% endhint %}

### Creating a Backup <a href="#sozdanie_arxivnoj_kopii" id="sozdanie_arxivnoj_kopii"></a>

1. Go to the **"Modules"** -> **"Marketplace of modules section"** tab.

<figure><img src="/files/nxz20KLrfQ4XbYk38h1T" alt=""><figcaption><p>Marketplace of modules section</p></figcaption></figure>

Make sure that the **Backup Module** is installed and enabled.

2. Go to the module settings.

<figure><img src="/files/Wbq29esk5VG2xdGcNU3l" alt=""><figcaption><p>Module settings</p></figcaption></figure>

3. Click on **"Create backup copy"**.

<figure><img src="/files/rCs9IkLIeNgHB6TnK7XL" alt=""><figcaption><p>"Create backup copy" button</p></figcaption></figure>

4. Select the data that should be included in the backup:

* **PBX Settings** - all **configuration settings** of MikoPBX made in the web interface.
* **Call History** - saves the **cdr.db** database (location: **/storage/usbdisk1/mikopbx/astlogs/asterisk/cdr.db**). This setting does not save actual call recordings, only the information on the **Telephony** → **Call History** (Documentation) tab without playback/download functionality.
* **Call Recording Files** - saves all call recordings in \*.mp3 format.
* **Sound Files** - saves sound files uploaded to the PBX in the **Telephony** → **Sound Files** (Documentation) section.

<figure><img src="/files/6BhakVGyi8AdTnqS4fZi" alt=""><figcaption></figcaption></figure>

5. Click on **"Create a backup"**.

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

Once the process is complete, the backup will appear in the list of backups:

<figure><img src="/files/6BJMXzaWHzMssPD69x35" alt=""><figcaption><p>Created copy</p></figcaption></figure>

### Managing Backup Files <a href="#upravlenie_fajlami" id="upravlenie_fajlami"></a>

In the backup list, you can perform the following actions:

* Restore from a backup.
* Download the backup archive.
* Delete the backup.

<figure><img src="/files/Ew846b2pZnfSAggfFNgs" alt=""><figcaption><p>Options</p></figcaption></figure>

### Restore from Backup <a href="#vosstanovlenie_iz_arxiva" id="vosstanovlenie_iz_arxiva"></a>

{% hint style="info" %}
The process of upgrading from **Askozia 4, 5 ME** to **MikoPBX** is described in this <mark style="color:red;">guide</mark>.
{% endhint %}

1. In the list of backups, select the desired one and click "**Restore from backup"**.

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

2. Select the categories of data to restore.

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

3. Click on **"Restore from a backup"**.

<figure><img src="/files/980RZyxKiOulo5wsP4mB" alt=""><figcaption><p>"Restore from a backup" button</p></figcaption></figure>

The restoration process will start, and once completed, the PBX will be rebooted.

The progress of data restoration will be displayed on the current page.

{% hint style="danger" %}
We recommend restoring the data in two stages:

1. Restore **Sound Files**, **PBX Settings**, and **Call History**.
2. Restore **Call Recording Files** - this is the longest stage.
   {% endhint %}

### Scheduled Backups <a href="#rezervnoe_kopirovanie_po_raspisaniju" id="rezervnoe_kopirovanie_po_raspisaniju"></a>

{% hint style="warning" %}

* **FTP Mode** - creates a **ZIP** archive. For this mode, an *FTP server* is required.
* **SFTP Mode** - creates an **IMG** container. This mode only requires *MikoPBX*.
* **WebDav Mode** - creates an **IMG** container.

**The fastest backup options** are **SFTP** and **WebDav**. FTP is outdated, and the ability to use this protocol will eventually be removed from the backup module.
{% endhint %}

1. Click the "**Backup schedule**" button to configure automatic backups.

<figure><img src="/files/N2O19Yzsf4cUDcQvEFS6" alt=""><figcaption><p>"Backup schedule" button</p></figcaption></figure>

2. To enable scheduled backups, activate the switch "**Scheduled Backup**."

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

3. Fill in the required information:

* **Server Address** - IP address of MikoPBX or the address of the SFTP \ FTP server.
* **Port** - for **SFTP** mode, the port is **22**. Disabling the "SFTP Mode" switch activates **FTP** mode with port **21**.
* **Username** - the username for server authentication.
* **Password** - the password for server authentication.
* **Server Path** - the directory where the backups will be saved. Recommended directory on MikoPBX: **/storage/usbdisk1/mikopbx/backup/**.

{% hint style="warning" %}
When using **WebDav**, the directory in the "Server Path" field must be created manually in advance.
{% endhint %}

* **Schedule** - specify the day and time for the backup operation.
* **Keep Last X Versions** - specify how many backup versions should be retained.
* **PBX Settings** - all **configuration settings** of MikoPBX made in the web interface.
* **Call History** - saves the **cdr.db** database (location: **/storage/usbdisk1/mikopbx/astlogs/asterisk/cdr.db**). This does not save actual call recordings, only the information on the **Telephony** → **Call History** tab without playback/download functionality.
* **Call Recording Files** - saves all call recordings in \*.mp3 format.
* **Sound Files** - saves sound files uploaded to the PBX in the **Telephony** → **Sound Files** section.

<figure><img src="/files/9vZVIX17pFLUt4syFQUy" alt=""><figcaption></figcaption></figure>

4. Click "**Save**."

<figure><img src="/files/1xVayQEEbT9WLoajH4CG" alt=""><figcaption></figcaption></figure>


---

# 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.mikopbx.com/mikopbx/english/modules/miko/module-quality-assessment.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.
