Backup and Restore

From Taridium

(Difference between revisions)
Jump to: navigation, search
 
(23 intermediate revisions not shown)
Line 1: Line 1:
-
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 basis.
+
These instructions apply to manual and semi-manual backups and restores. For GUI based backup and restore refer to the '''[[Configuration Backup|Configuration → Advanced Setup → Backup]]''' section.
-
'''Customers that have a direct Taridium maintenance contract do not need to backup files manually - this is provided on a bi-weekly basis.'''
+
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.
Configuration data for ipbx is stored almost exclusively in the ipbx MySQL database. This includes all your phone configuration, dialplan etc.
Line 15: Line 17:
   ************************************************************
   ************************************************************
                                                                
                                                                
-
     ipbx 2.0.0-a Configuration                       
+
     ipbx 2.6.1-a Configuration                       
-
     (c) 2008 taridium, llc                                   
+
     (c) 2014 taridium                                
                                                                
                                                                
   ************************************************************
   ************************************************************
Line 39: Line 41:
Note that depending on your CDR deletion schedules this file can have a considerable size.
Note that depending on your CDR deletion schedules this file can have a considerable size.
-
== Database Restore ==
+
== Restore ==
 +
 
 +
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 [http://web6.taridium.com/taridium-repo-1.0-a.noarch.rpm taridium-repo] and follow standard [[Installing_ipbx|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.
On a clean install from scratch, always run ipbx-config with option '''1''' to configure DB users and permissions.
Line 55: Line 61:
   mysql> SOURCE ipbx-backup-1228313758.sql;
   mysql> SOURCE ipbx-backup-1228313758.sql;
-
make sure that the ipbx database is up-to-date by running the safe updater with ipbx-config option '''6'''.
+
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 ===
=== Device Configuration Files ===
-
After a complete system restore (database restored) you can restore all device configuration files by clicking on '''System''' →  '''Devices''' → '''Generate Configurations'''. Make sure your devices are setup for [[Auto-provisioning|auto-provisioning]].
+
After a complete system restore (database restored) you can restore all device configuration files by clicking on '''System''' →  '''Devices''' → '''Generate Configurations'''. Make sure your devices are setup for [[Auto-provisioning|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|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 ==
== Other Files ==
-
These files are usually not created on the system, but rather uploaded or created through customizations. It might still make sense to back them up, though. These include interface configuration files for PSTN/TDM cards.  
+
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 ===
Line 72: Line 88:
Music on hold is stored in /var/lib/asterisk/moh-native/[class name]
Music on hold is stored in /var/lib/asterisk/moh-native/[class name]
 +
 +
=== Voicemail ===
 +
 +
Voicemail files including [[User_Call_Recording|one-touch]] recordings are stored in /var/spool/asterisk/voicemail
 +
 +
=== Call Recording ===
 +
 +
[[Call Recording|Recorded calls]], except for [[User_Call_Recording|one-touch]] recordings are stored in the '''monitor''' MySQL database (recording table).
=== PSTN Interface Cards===
=== PSTN Interface Cards===
-
Relevant configuration files are stored in:
+
Relevant configuration files for Sangoma interface cards are stored in:
-
   /etc/wanpipe/
+
   /etc/wanpipe/ for Sangoma cards
-
   /etc/zaptel.conf
+
 
-
   /etc/sysconfig/zaptel
+
   /etc/zaptel.conf for Digium and compatible cards using Zaptel drivers
 +
   /etc/sysconfig/zaptel  
 +
 
 +
  /etc/dadhi/system for Digium and compatible cards using DAHDI drivers

Latest revision as of 12:26, 26 August 2014

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.

Contents

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
      configuration
 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.

Restore

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

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/sysconfig/zaptel 
 
 /etc/dadhi/system for Digium and compatible cards using DAHDI drivers
Personal tools
Namespaces
Variants
Actions
Toolbox