> For the complete documentation index, see [llms.txt](https://docs.itgrix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.itgrix.com/for-admins/deploying-a-module-backup.md).

# Deploying a module backup

While updating the module to a newer version, the user is suggested an option to make a backup of the previous version. It may be necessary sometimes to roll back to the previous version using these backups.

First, you need to stop the module's service:

```
service itgrix_bx stop 
```

By default, backups are created in the `/opt/itgrix_bx_backups/` directory as a subdirectory named with the module name, date, time and version, e.g. `/opt/itgrix_bx_backups/itgrix_bx-20220829-173241-3.9.3/`.

Inside, there are two folders: `/opt/` and `/etc/`. To restore the module from the backup, you need to replace the current contents of the module directories `/opt/itgrix_bx/` and `/etc/itgrix_bx/` with those from the backup directories.

After replacing the files, set the owner and group (asterisk by default) just in case:

```bash
chown -R asterisk. . /opt/itgrix_bx/

chown -R asterisk. . /etc/itgrix_bx/
```

Next, you need to clear the `/opt/itgrix_bx/state.json` file to prevent the module from re-reading all the calls since the time of the backup:

```bash
>/opt/itgrix_bx/state.json
```

Start the module service. You may need to re-authenticate the module in the portal through the admin panel after that.

```bash
service itgrix_bx start
```


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.itgrix.com/for-admins/deploying-a-module-backup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
