SARK V4.0.0 Backup

From sailpbx
Jump to: navigation, search

back to SARK v4.0.0 contents

Backup

All of SARK's PBX entities are kept on a single SQL database file which is easy to backup and restore. SARK has 2 kinds of backup called backups and snapshots. By default, a backup will be taken every night with the last 9 copies being kept. A snapshot is taken every time you issue a commit with the last 9 copies kept. You can click on the download icon of any backup or snapshot to download it to your desktop. The backups and snapshots themselves can be found in /opt/sark/snap and /opt/sark/bkup so you can easily write a cron job to offload them to other systems or media for safe keeping if you wish.

root@s200:~# ls  /opt/sark/bkup/
sarkbak.1365735601.zip	sarkbak.1365994801.zip	sarkbak.1366254001.zip
sarkbak.1365822001.zip	sarkbak.1366081201.zip	sarkbak.1366340401.zip
sarkbak.1365908401.zip	sarkbak.1366167601.zip	sarkbak.1366348979.zip
root@s200:~# ls  /opt/sark/snap/
sark.db.1366024598  sark.db.1366024836	sark.db.1366111208
sark.db.1366024698  sark.db.1366024898	sark.db.1366297330
sark.db.1366024783  sark.db.1366111077	sark.db.1366315607

As you can see from the listings above, the file names end in a ten-digit number. This is actually the Linux "epoch" timestamp at the time the backup or snap was taken. This means that even if, for example, the file is moved to another system, it is still easy to determine the date it was created. Just go to http://www.epochconverter.com/ and paste the epoch into the converter you will find there. Here is an example using the file sark.db.1366315607 from the listing above.



V4 backup 6.png



Backup Vs Snapshot

A backup is a zip folder containing:-

  • the SARK database
  • all voice-mails on the system
  • all usergreetings you have created
  • the entire /etc/asterisk control-file folder

A snapshot is a copy of the SARK database only.



V4 backup 1.png



Taking an instant backup or snapshot

You can take an instant backup by clicking the blue "backup" button at the top right of the backup panel. You can take an instant snapshot by issuing a commit.

Regress

You can regress the system to any previous snapshot by clicking on the regress icon for that entry on the snapshot panel (see below).



V4 backup 5.png



This will regress the database back to the image you've chosen. If you then press commit, the regression will be applied to the running PBX.

Restore from a backup

Restoring from a full backup is more complex since it is designed to be used after a catastrophic failure such as failed or corrupted media. In such cases you would:-

  • If necessary, replace the failed media volume
  • Re-install SARK from the vendor-provided ISO CD.
  • Unzip your backup onto a USB drive and mount the drive on the SARK system
  • Manually copy any voicemail or greetings you wish to preserve from the USB drive to the PBX.
  • After a re-install it usually isn't necessary to copy the Asterisk control files unless you have custom changes of your own.
  • Copy the SARK database to /opt/sark/db
  • Run the SARK database updater
sh /opt/sark/scripts/updatedb.sh
  • Issue a commit to fetch the database into service

Regress from an off-line snapshot

You can upload an offline snapshot as long as you have access to it from your PC. Click on the Upload tab and then the Choose button. Click on a snapshot press the blue "upload" button at the top right of the panel. The file will be checked and if it is OK, uploaded into the snapshot list. You can then regress to it in the normal way.