In this guide, you will gain comprehensive insights into the seamless generation of a backup file in anynode.

Create Backup

In this segment, you will gain comprehensive insights into the seamless generation of a backup file, with the added convenience of automation via REST API integration.

The default user anadmin has all rights for creating a backup, with one exception: the backup of media recordings can only be performed by a new user with administrator and media recorder roles.

To secure recorded sessions, create a new user with administrator and media recorder roles through anynode's user management

Please note that the file size can increase when many recordings are included in the backup.

Then, initiate the backup function with this newly created user.

Click on Extras, User Management and Users, Roles & Policies in the upper menu. At this point, we won't describe the individual steps in the anynode user management. However, you can typically use the default values there.

Screenshot: navigation path to anynode user management overview in anynode frontend. Screenshot: navigation path to anynode user management overview in anynode frontend.
navigation path to anynode user management overview in anynode frontend.
Screenshot: anynode user management and an added user with administrator and media recorder roles. Screenshot: anynode user management and an added user with administrator and media recorder roles.
anynode user management and an added user with administrator and media recorder roles.

Now let's consider the individual steps for creating a successful backup.

Click on Configuration and Backup in the upper menu. Choose what to include in the backup. Either the complete configuration can be exported, or only the configuration of a specific service.

The first option, Full Configuration Backup, encompasses the anynode configuration along with audio files and static HTTP server resources. It includes the anynode frontend configuration and the anynode monitor configuration, excluding the call history and event log.

The second option Full backup allows for maximum data backup. In our example, we will opt for the second option.

Normally, this option would encompass recorded sessions. However, in our example, we have the default anadmin user as the current user. The default user anadmin lacks permission to access the recordings, so the recordings will be excluded. To secure recorded sessions, create a new user with administrator and media recorder roles through anynode's user management.

The third option Select manually what will be included enables individual selection.

Click on the Next button to continue.

Screenshot: anynode frontend with configuration backup assistant and backup options. Screenshot: anynode frontend with configuration backup assistant and backup options.
anynode frontend with configuration backup assistant and backup options.

You have the option to protect the downloaded backup files with a password.

This is the default setting. Activate Encrypt the data with a password.

Your password should have a minimum of eight characters. Number sequences are not allowed. It is recommended to use a combination of upper- and lowercase letters, numbers, and symbols. Avoid using words or names of people, characters, organizations, products, or anything else that can be easily guessed or associated with you.

Click the Next button to proceed.

Screenshot: anynode frontend with configuration backup assistant and encryption option.
anynode frontend with configuration backup assistant and encryption option.

The assistant suggests a file name with date and time, but you can also freely choose your own.

Click on Finish .

Screenshot: anynode frontend with configuration backup assistant and filename setting.
anynode frontend with configuration backup assistant and filename setting.

anynode will gather all the necessary data and save it as a ZIP file. The compilation of the required data is done in the background, allowing you to continue working in the frontend during this process. An additional status window will keep you informed about progress. Please ensure the download is complete before using the ZIP file.

Click on the Close button.

Screenshot: anynode frontend with backup download window.
anynode frontend with backup download window.

Afterward, a zipped file will be downloaded to your system's download folder. Depending on the chosen backup type and media recorder rules, you will find a folder structure with recordings.

Screenshot: Windows download folder with downloaded backup folder structure.
Windows download folder with downloaded backup folder structure.


Create Configuration Backup via REST API and Windows PowerShell

The anynode REST API support and Windows PowerShell allow you to automate the backup process, enabling you to schedule regular backups without manual intervention. This ensures that critical configurations and data are consistently backed up at specified intervals. We would like to point out that the following commands only work for Windows PowerShell users.

To utilize the REST API, you can either use the existing default connector or create a new one.

It's crucial to enable the REST service explicitly on the connector intended for API access. Please note that the previously mentioned rights for administration and media recorder are also necessary in this context. You need at least anynode version 4.12 or later.

Refer to our REST API documentation for more details: In the upper anynode frontend menu, navigate to Info and REST API Documentation (read chapter 1 General).

Screenshot: anynode frontend with integrated REST API documentation in the info menu. Screenshot: anynode frontend with integrated REST API documentation in the info menu.
anynode frontend with integrated REST API documentation in the info menu.

The default connector for the anynode frontend at http://127.0.0.1 already has activated rights for access via REST API. To check if your connector has REST API rights, navigate to the top menu,

go to Extras, Web Server, Connectors. Choose a connector and click on the Edit button. The Web Server Connector Assistant will open.

Click on the Next button.

Under Services, check if REST API is enabled.

Then, click on the Finish button.

Screenshot: anynode frontend with web server connector assistant and activated REST API service Screenshot: anynode frontend with web server connector assistant and activated REST API service
anynode frontend with web server connector assistant and activated REST API service

In our example, we will use the default connector at http://127.0.0.1 and the Windows PowerShell Integrated Scripting Environment (ISE).

Open Windows PowerShell ISE.

Before you can use the API, the anynode PowerShell module needs to be imported. Depending on the operating system, the module file can be found here:

Windows: C:\Program Files\TE-SYSTEMS\anynode frontend\res\powershell

Linux: /opt/tesystems/anynodefe/res/powershell

When importing a module in PowerShell, you might encounter the need to change the execution policy with:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process

Click on the Yes button to change the execution policy.

Screenshot: Windows PowerShell ISE command for execution policy change. Screenshot: Windows PowerShell ISE command for execution policy change.
Windows PowerShell ISE command for execution policy change.

Execute the command to import the anynode PowerShell module:

Import-Module -Name "C:\Program Files\TE-SYSTEMS\anynode frontend\res\powershell\anynode_rest_api_powershell.psm1" -Verbose

If needed, verify the path and filename of the module.

Click on the Run once button to run the script.

Screenshot: Windows PowerShell ISE command for import of the anynode PowerShell module. Screenshot: Windows PowerShell ISE command for import of the anynode PowerShell module.
Windows PowerShell ISE command for import of the anynode PowerShell module.

In our example, we are using the default connector for the anynode frontend without a certificate. This command disables certificate checks for the rest of the PowerShell session:

Disable-CertificateCheck

If you are using a self-signed certificate for the connection, you can temporarily trust the certificate with the following command:

Get-anynodeWebserverCertificate
Screenshot: Windows PowerShell ISE command for disabling the certificate check. Screenshot: Windows PowerShell ISE command for disabling the certificate check.
Windows PowerShell ISE command for disabling the certificate check.

Now execute the command to create the backup file. In our example, we demonstrate the creation of a full configuration backup. If you only want to secure individual components, you must use request parameters for included data.

Here, we are using the default address and port of the anynode frontend, along with the standard user anadmin. Adjust these values if you are using a different connector or user.

Create-anynodeConfigBackup -Address 127.0.0.1 -Port 8088 -Credential anadmin

For a full backup, use the following request parameters for included data:

Create-anynodeConfigBackup -Address 127.0.0.1 -Port 8088 -Credential anadmin -IncludedData ('ANYNODE_CONFIG', 'MEDIA_FILES', 'HTTP_SERVER_FILES', 'FRONTEND_CONFIG', 'MONITOR_CONFIG', 'CALL_HISTORY', 'EVENT_LOG')

MEDIA_FILES refers to the audio files configured in the node under "Tones and announcements". To include recordings, you would need to add RECORDINGS to the list. Remember that you need a user with administrator and media recorder roles to access the recordings.

Subsequently, enter your password for accessing anynode in the Windows PowerShell credential request.

Click on the Ok button.

Screenshot: Windows PowerShell ISE command for creating the anynode backup. Screenshot: Windows PowerShell ISE command for creating the anynode backup.
Windows PowerShell ISE command for creating the anynode backup.

Enter a filename for the backup file. The file format is .zip and should be included in the filename.

Subsequently, the compressed backup file will be generated, downloaded, and saved in the specified path.

Screenshot: Windows PowerShell ISE with saved anynode backup. Screenshot: Windows PowerShell ISE with saved anynode backup.
Windows PowerShell ISE with saved anynode backup.


Create Configuration Backup via REST API on Linux with Shell Script

For Linux users not using PowerShell, we provide an included shell script that only needs minimal editing of the parameters. anynode provides the corresponding shell script with every Linux installation. The path to the script is:

/opt/tesystems/anynodefe/res/shell/

To utilize the REST API, you can either use the existing default connector or create a new one.

It's crucial to enable the REST service explicitly on the connector intended for API access. Please note that the previously mentioned rights for Administration and Media Recorder are also necessary in this context. You need at least anynode version 4.12 or later.

Refer to our REST API documentation for more details in the following steps in the web server connector assistant. Our REST API documentation can be accessed directly through the anynode frontend: In the upper anynode frontend menu, navigate to Info and REST API Documentation, and read chapter General.

Screenshot: anynode frontend with integrated REST API documentation in the info menu. Screenshot: anynode frontend with integrated REST API documentation in the info menu.
anynode frontend with integrated REST API documentation in the info menu.

To check if your connector has REST API rights, navigate to the top menu, go to Extras, Web Server, Connectors. Choose a connector and click on the Edit button.

The Web Server Connector Assistant will open.

Click on the Next button.

Under Services, check if REST API is enabled.

Then, click on the Finish button.

Screenshot: anynode frontend with web server connector assistant and service restrictions. Screenshot: anynode frontend with web server connector assistant and service restrictions.
anynode frontend with web server connector assistant and service restrictions.

Open your terminal or shell application on your anynode server or connect over SSH.

We recommend not executing the script in the same directory but rather in the folder where you intend to store the backup file afterward. Here is an example where the script is copied from its original location to the directory /home/anadmin/:

cp /opt/tesystems/anynodefe/res/shell/backup.sh /home/anadmin/backup.sh
Screenshot: Edit parameters in shell script for a backup via REST API Screenshot: Edit parameters in shell script for a backup via REST API
Edit parameters in shell script for a backup via REST API

Now, you must input the IP address under which the anynode frontend is accessible, as well as the authentication credentials of the user from the anynode installation with the necessary permissions, into the script.

The command nano ./backup.sh opens the Nano text editor, allowing you to edit the content of the "backup.sh" file.

Navigate to anynode='127.0.0.1 and enter the address and port of the anynode frontend.

In our example, this is 172.18.0.149:443

Navigate to path= and specify the path where the backup file should be saved.

In our example, we use the ./ command to execute a program or script in the current directory.

Navigate to cred='anadmin:password' and enter the credentials of an anynode user with configuration write access and REST access.

Go to backupParameter and modify the backup parameters to your needs.

The default script creates a full backup excluding recordings.

To include recordings, you would need to add RECORDINGS to the list. Remember that you need a user with administrator and media recorder roles to access the recordings.

Save the script with Control + O

Close the script with Control + X

Make the script executable afterward by executing:

chmod +x ./backup.sh

In the context of performing a backup command via REST API, curl is employed to send HTTP requests to the REST API endpoint responsible for initiating the backup process. Install curl with the following command, if necessary:

apt install curl

Execute the script:

./backup.sh

Use dir or ls to display the contents of the current directory.

The backup file is generated and saved. The ZIP file is timestamped in the filename, facilitating control over a current backup.

Screenshot: Executed shell script and generated backup ZIP file. Screenshot: Executed shell script and generated backup ZIP file.
Executed shell script and generated backup ZIP file.


Backup with a Hot Standby System

With the anynode hot standby feature, you define important rules so that a secondary anynode system can take over in an emergency as part of a high availability configuration. Via the graphical user interface of this feature, all conditions for a switchover to the secondary standby system and back can be individually set. If you intend to perform a backup and restore using a hot standby system, there are several crucial considerations to keep in mind:

Backup primary system: Create a backup as described previously. Ensure that the backup includes at least the frontend configuration.

Backup secondary system: Do not use the combo box in the top right menu to switch to the secondary system. You must physically access the frontend of the secondary system.

Create a backup here as described previously, ensuring that it includes at least the frontend configuration.



Performing Backup When Call History and Events Are Stored in an External Database

For external call history and event databases, backup and restore operations are not conducted; these processes are exclusive to the internal (SQLite) database. Only the access to the external database is backed up and restored.

For the external database, utilize a full backup including the anynode monitor configuration under the backup options. The anynode monitor configuration always includes the setup for accessing the external database.