Zum Hauptinhalt springen

PBX Cloud Backup Tool

PBX Backup via HTTPS over the Web

This utility provides a secure method for backing up the PBX configuration and data through an HTTPS connection. It operates by recursively traversing the current working directory, copying all relevant files and subdirectories to the designated local directory specified by the user.

  • Use this option for web-based backups if SSH access is unavailable. For faster alternatives, refer here.
  • Due to size constraints, the following directories will be excluded from this process - 'astatd', 'astath', 'astatm', 'astatw', 'billcdr', 'billcfg', 'billdata', 'blocklist', 'cdre', 'cdri', 'cdrt', 'connections', 'emails', 'gstatd', 'gstath', 'gstatm', 'gstatw', 'pcap', 'registrations'
  • --disable-downloads option allows for the deactivation of this feature during PBX installation.
  • This tool requires administrator access with API functionality enabled.

You will need to install Node.js and npm

Install the Vodia PBX Admin Tool via NPM.

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g pbx-backup-tool

Verify the instalation

pbx-backup --version
1.0

Configuration

This tool requires a configuration file located at ~/.pbx-admin.conf

This file must include the following settings:

  • username
    The administrator username.

  • password
    The administrator password.

  • server
    The server address.

  • pbx_work_dir The working directory of the Remote target PBX (you can find this infromation under Admin Status page)

  • pbx_target_dir Local backup folder location

Ensure that this file is properly configured before using the tool.

Example Configuration File:

Create the file - nano ~/.pbx-admin.conf

username:admin 
password:securepassword123
server:https://pbx1.example.com
pbx_work_dir:/usr/local/pbx
pbx_target_dir:/usr/local/pbx-backup

Usage Example:

pbx-backup backup

Example Output:

? Have you whitelisted the WAN IP of this machine on the remote PBX? Yes
? This will back up the entire PBX, which may take time and increase CPU usage on the remote server. Do you want to proceed? Yes
Starting backup to: /usr/local/pbx-backup
Created directory: /usr/local/pbx-backup/accesslist
Created directory: /usr/local/pbx-backup/acds
Created directory: /usr/local/pbx-backup/activity
Created directory: /usr/local/pbx-backup/admins
Created directory: /usr/local/pbx-backup/adrbook
Created directory: /usr/local/pbx-backup/apptokens
Skipping excluded directory: astatd
Skipping excluded directory: astath
Skipping excluded directory: astatm
Skipping excluded directory: astatw
Created directory: /usr/local/pbx-backup/attendants
Created directory: /usr/local/pbx-backup/audio_ar
Created directory: /usr/local/pbx-backup/audio_au
Created directory: /usr/local/pbx-backup/audio_ca
Created directory: /usr/local/pbx-backup/audio_de
Created directory: /usr/local/pbx-backup/audio_en
Created directory: /usr/local/pbx-backup/audio_en/synth

To get help with usage, simply use the --help flag.

root@vodia-staging:~#  pbx-backup --help
Usage: pbx-backup [options] [command]

Vodia PBX Backup Tool

Options:
-V, --version output the version number
-h, --help display help for command

Commands:
backup Run PBX backup
help [command] display help for command

Performing a PBX Restore

After backing up the PBX data, you can easily restore it. For example, let's assume your backup data is located at /usr/local/pbx-backup and you're using an Ubuntu or Debian system.

Here's the restoration process:

  • Install the Vodia PBX: Follow the installation instructions found here. The default working directory is typically /usr/local/pbx.

  • Stop the PBX service: Execute the command systemctl stop pbx to halt the currently running PBX.

  • Replace the working directory: Copy or move the backup data from /usr/local/pbx-backup to /usr/local/pbx, overwriting the existing files.

    mv /usr/local/pbx /usr/local/pbx-old
    mv /usr/local/pbx-backup /usr/local/pbx
  • Finally, restart the PBX service using the command: systemctl start pbx