Backup and Restore

From Taridium

Revision as of 12:26, 26 August 2014 by Webmaster (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

These instructions apply to manual and semi-manual backups and restores. For GUI based backup and restore refer to the Configuration → Advanced Setup → Backup section.

While there are a number of ways to backup a complete system using disk images etc. it might be more practical and safe to backup the ipbx configuration on a regular schedule.

Customers that have a direct Taridium maintenance contract do not need to backup files manually - this is provided on a bi-weekly basis by the remote monitoring client.

Configuration data for ipbx is stored almost exclusively in the ipbx MySQL database. This includes all your phone configuration, dialplan etc.

Some additional configuration data is present in other files as well. This applies especially to PSTN interface card configuration and other interconnection hardware.


Database Backup

Login to your server via SSH and run the ipbx-config script from the server command line:

 [root@pbx ~]# ipbx-config
   ipbx 2.6.1-a Configuration                      
   (c) 2014 taridium                                  
 Select Configuration Option:
 1 <- Configure ipbx for the first time and use default
 2 <- Create full database backup
 3 <- Fix file system permissions
 4 <- Restore default ipbx database (will erase all settings)
 5 <- Reset admin password
 6 <- Upgrade ipbx database (safe mode)
 0 <- Exit
 please enter your choice:

Select option 2 to create a full database backup. Enter your MySQL root password (ususally empty/blank). A time-stamped backup will be created in /usr/local/ipbx/backup/

Note that depending on your CDR deletion schedules this file can have a considerable size.


To restore ipbx, we recommend that you install a fresh copy of ipbx using the supplied ISO image. If you are restoring from a standard CentOS or RedHat compatible OS, use the repository package taridium-repo and follow standard installation instructions before proceeding with a database restore.

Database Restore

On a clean install from scratch, always run ipbx-config with option 1 to configure DB users and permissions.

To restore your database, cd into the backup directory and use the mysql client to reload the datbase:

 [root@pbx ~]# mysql 

remove any existing ipbx database. Note this will erase any existing configuration!

 mysql> DROP DATABASE ipbx;

load the backup file:

 mysql> SOURCE ipbx-backup-1228313758.sql;

after the database has been restored, make sure that the ipbx database is up-to-date by running the safe updater with ipbx-config option 6.

Device Configuration Files

After a complete system restore (database restored) you can restore all device configuration files by clicking on SystemDevicesGenerate Configurations. Make sure your devices are setup for auto-provisioning. On the command line you can run ipbx-autoprov and select the used device types. Make sure the master files have the correct IP address configured if you have a multi-homed system.

Manual Database Backup

The ipbx database can also be backed-up manually using standard MySQL tools. This is recommended if you are planning to write your own backup script and require more control of backed up data.

Backing up the ipbx Database

 /usr/bin/mysqldump -B -Q --ignore-table=cdr -u root -pPASSWORD ipbx > backup-file.sql

In the example above the MySQL root password is set to PASSWORD and we're excluding the table cdr (CDR data). The cdr table, unless stored in a separate database can grow fairly large depending on your call volume and it might make sense to keep this data backed-up separately, directly on a different host or in a different backup file.

Other Files

These files are usually not created on the system, but rather uploaded or created through customizations and during use. It might still make sense to back them up, though.

Custom Prompts

Custom prompts are stored in /var/lib/asterisk/sounds/prompts/

Music On Hold

Music on hold is stored in /var/lib/asterisk/moh-native/[class name]


Voicemail files including one-touch recordings are stored in /var/spool/asterisk/voicemail

Call Recording

Recorded calls, except for one-touch recordings are stored in the monitor MySQL database (recording table).

PSTN Interface Cards

Relevant configuration files for Sangoma interface cards are stored in:

 /etc/wanpipe/ for Sangoma cards
 /etc/zaptel.conf for Digium and compatible cards using Zaptel drivers
 /etc/dadhi/system for Digium and compatible cards using DAHDI drivers
Personal tools