Backup and Restore FreePBX

Updated 14 June 2017

 

This Blog is about how to take Backup of freepbx data from browser and restore that backup.

FreePBX offers a support package that includes automated offsite backups. This module is used to backup our PBX phone system settings and configurations.This module will backup databases, stored settings, and specified files and directories.

         Note: your backup server and restore server should be on the same version.

Backup and Restore module Location

  • Log in to the PBX UI.
  • On the top menu click Admin
  • In the drop down click Backup and Restore.

we will see a list of the current backup jobs we have created, and any that were created by default.

Menu Items

Click the menu button, at the right to expand the menu.

Backups

The Backups section of the backup module is where we actually define a backup job.we can create as many backup jobs as we want and set when and how often they should run, what should be included in the backup, and where to store it.

Restores

The Restore section of the backup module is where we restore from a backup. we can restore from a backup on our local computer or from any defined FTP, SSH or Local storage server.

  Servers

The Servers section is where we define any PBX servers or database tables that we want to backup configurations from. we also define Linux boxes or FTP servers we want to store the backups on.

  Templates

Templates are used to create groups of files, directories, or databases that we want to include in a backup. When creating a backup job, we can drag one or more templates into it to define what is going to be backed up.

Backup Settings

Click the New Backup button to create a new backup, or click an existing backup to edit its settings.

Backup Name

Give backup job a name to easily identify it.

Description

Here we can optionally define a longer description or add notes.

Status Email

If defined, the system will send status updates to this e-mail address when the backup task is run.

Items

This is where we choose what will actually be backed up. On the right side we will see a list of standard templates that are included with our PBX. The most standard template we would want to use for a normal daily backup is the Full Backup.

To include the full backup template, drag it from the Templates bin to the Items bin.

Note: Advanced users can also press the plus sign icon to add our own files or directory paths to be included in a backup.

Once we add an item, we will see the items that will be backed up, as well as any exclusions:

Note : The Full Backup template does not include any voicemails, custom music on hold, or system prompt recordings. If we want these to be included, drag the “System Audio” and “Voicemail Templates” from the Templates bin to the Items bin.

Hooks

Hooks allow us to base the backup job on the following actions in order to execute a custom script at the location defined for each action. This is for advanced users who would like to customize the following actions.

Note: Make sure that the script has execute permissions for the Asterisk user.

Pre-Backup Hook

Hook to run before starting the actual backup.

Post-Backup Hook

Hook to run after completing the backup.

Pre-Restore Hook

Hook to run before starting the actual restore of the backup.

Post-Restore Hook

Hook to run after completing the restore of the backup.

Backup Server

This is where we choose which server to back up. This can be the local PBX that the backup module is on, or it could be another PBX as defined in the servers section of the backup module.

Storage Location

Storage locations are servers that have been set up to store the actual backup on. By default we include the local server as a storage location.

– Local Storage: The backup tarball file is stored in “/var/spool/asterisk/backup/(backupjobname)/*.tgz” on the local machine.

 The Available Servers list shows servers that have been set up to store the backup as defined in the servers section of the backup module. Please see server section for more information on defining other servers.

The Storage Servers list defines where to store the backups. Drag one or more storage servers from the Available Servers bin to the Storage Servers bin.

Backup Schedule

Never

Never run the backup

Hourly

Every hour at the top of the hour

Daily

Every day at midnight

Weekly

Every Sunday at midnight

Monthly

This first of each month at midnight

Annually

January 1st at midnight

Reboot

On a reboot command of the PBX an upgrade will be run.

Custom

Allows us to define our own schedule on when to run upgrades.

Maintenance

Here we can define how many copies of the backup we want to keep and when they should be deleted.

Delete After Time Frame

Here we can define increments, for example delete after 3 months or 5 weeks.

Delete After Runs

Here we can define how many copies of the backup to delete versus deleting backups by time frame such as only keep fifteen. On the 16th backup the oldest backup will be deleted from the system. We recommend keeping 7-10 backups only to conserve hard drive space .Then Press ‘Save’ button at the bottom of browser and then press ‘and Run’ button.

We can Download and save the backup file to any other location From Restore section we can select local Storage and then selecting any compressed file then pressing Download.

When we do this, a window will pop-up displaying the status of the backup. we should see “Backup successfully completed!

Restore

In the Restore section, we can select a server to restore the backup from, or select a backup file on our local computer.

Restoring from a Server

Available servers are shown at the bottom of the list on the right side of the screen. Select a server.

Available backups will be displayed. Browse the folders to view available files.

Browse the folders and select a backup to restore from. More details will be shown to the right.

Click the Go! button. You will be taken to a page where you can select which items to restore.

Use the check boxes to select which items to restore, then click the Restore button also select PBX Settings and CDR’s checkbox.

A window will pop up showing the status of the restore.

The status window will say Done! when the restore is complete.

Restoring from a Local File

We can upload a backup file from our local computer if we have it stored on the same computer we are using to log into the Backup & Restore module.

  • In the Restore section of the Backup & Restore module, click the Browse button.
  • Select a file from local computer.
  • Click the Restore button to begin the restore process. we will be taken to a page where we can select which items to restore.
  • Use the check boxes to select which items you would like to restore, then click the Restore button also select PBX Settings and CDR’s checkbox.

A window will pop up showing the status of the restore.

 If backup file is not showing in Restore Tab list then, download it from browser and add that .tgz file to the default location of backup i.e. /var/spool/asterisk/backup/filename.tgz through command line.

The status window will say Done! when the restore is complete.

   it may ask to run a “amportal a ma installall” command, just open command line prompt and run the command there.

Servers

The Servers section shows the servers that have been created and allows us to create new servers.

Backup Server Types

Email

Sends a backup file as an email attachment.

FTP

Sends a backup file to an FTP server. The backup can be directly restored from the FTP server.

Local

This is the local PBX (server) that the backup is stored on. The backup job will be performed on this local server and can be restored from here as well.

MySQL Server

This is where we define where the MySQL server is located and how to log into it so we can back up the database.

SSH Server

This could be another PBX that you log into and perform the backup on. For example, if we have a warm spare backup box, we would set up the backup job on the warm spare to log into the production server, perform the backup on the production server, and then move the backup file to the backup server and restore it on a nightly basis.

Note: we can also define a SSH server for storing backups just like an FTP server, and using SCP to copy the files over to the SSH server. Any Linux box that supports SCP can be an SSH Server.

    These all are from backup and restore part…

IN CASE OF ANY QUERY, CONTACT US

Category(s) Uncategorized
author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project




    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home