Backup and Restore
The backup and restore feature on both the asterisk@home and trixbox are great, but it would even be better if the backup can be exported and saved remotely such that if the system goes down one can just restore from such a backup file and be up and running as before in no time. This will also help in deploying the same configuration and settings on several astrisk@home and trixbox servers in no time, virtually as fast as one can click to import/upload and restore from the exported backup file.
The most current version of FreePBX has this feature in it. After upgrading, you can go into amportal.conf and the settings for a remote FTP site are at the bottom. Then it will use the Backup schedule from the Backup and Restore page to create the file and FTP it to remote location.
-Kerry
sorry TROFFASKY,
it's called 'philippe is lazy.' as well as I personally believe gui's get overdone. Setting this up in the amportal.conf file is trivial, use your text editor as your 'gui' :-)
anyhow - the addition I made is trivial and as Kerry points out it is up on svn head at freepbx. If you really don't want to upgrade - you can simply grab ampbackup.pl off svn head and stick it into your current trixbox in place of what is there - then just add the required amporal.conf settings any you are set.
p
i took a look at amportal.conf - the bottom of the file, and see nothing there regarding a remote ftp site. am i just over looking it?
(i'm using trixbox 1.1.1)
kerryg wrote:
The most current version of FreePBX has this feature in it. After upgrading, you can go into amportal.conf and the settings for a remote FTP site are at the bottom. Then it will use the Backup schedule from the Backup and Restore page to create the file and FTP it to remote location.
-Kerry
i took a look at amportal.conf - the bottom of the file, and see nothing there regarding a remote ftp site. am i just over looking it?
(i'm using trixbox 1.1.1)
kerryg wrote:
The most current version of FreePBX has this feature in it. After upgrading, you can go into amportal.conf and the settings for a remote FTP site are at the bottom. Then it will use the Backup schedule from the Backup and Restore page to create the file and FTP it to remote location.
-Kerry
OH first off the feature is not in TrixBox...you must update Freepbx to get the feature and even then it will take some work.
Now...
To use the built in backup
Login as user with backup right, create backup job, run backup job.
use ssh login go to /var/lib/asterisk/backups copy out backup to local PC.
Or create a cron to do it or use third party app to copy offsite..
to restore..rebuild system to same point, less config files .
ssh into box dump backup in /var/lib/asterisk/backups and then login and run restore..
That is all there is to
It is easy do not make it hard...
Thanks this is helpful.
We are trying auto-update a secondary Trixbox.
Do you have the backup and restore commands in a textfile? - so that we can run them in a command line script.
If we restore the files to a secondary Trixbox with a different IP do we need to change permission or anything else?
G
OK have you looked at the backup script??
/var/lib/asterisk/bin/ampbackup.pl
with the Asterisk and MYSQL the conf file are built on the fly
/var/lib/asterisk/bin/retrieve_conf
Think Rsync...
so what need to do is the MYSQL updates on the second box (amportal stop and configure it as a clone of the live box)
use fqdn names when you can and if you setup DNS failover that will give you what you wish..
http://www.simplefailover.com/
Thanks your comments are very helpful. In all SIP implementations we may just rely on primary and secondary SIP proxy designations (e.g. the IP phones and gateways).
The rsync philosophy is good. We want the servers to sync periodically (e.g. once a week) with no human intervention while keeping copies of the back-ups for a while. So if something goes wrong on the primary Trixbox, the automated back-up does not replicate the damaged data overwriting the only good copy on the back-up.
G
I only use IAX and they allow for 2 servers (failover) only they are IP only (no fqdn), but all mine are static IP's so no problem for me.
if you are worried about the config.
I think that TrixBox is doing a backup each nite is it not???
Are you getting the email for root / admin ???
You should be getting two or three emails a day with the logs.
(I guess that feature is still in the builds..I do not run Trixbox YET)
If you are really wanting to do it right then setup a box go out and grab those .tar file(s) each nite and keep 7 ~ 14 days of data..
Drive space is cheap Data is not...
Find some offsite to dump.. ftp it to a cheap offsite backup
Or find someone who runs a StorGrid (Rsync engine) server and install the agent you should get a 1~5 gig account 20.00 ~ 30.00 and month
Or look at WINSCP and the Command line options
sync remote folders when a change is made on one
it watch's a folder for say new voice mail and if one comes in the file is sent to the second server as soon as the dirty bit is written.
philippel,
This auto-ftp is EXACTLY what I want. I finally figured out that it's not in the currently released code (2.1.3) but rather on the "root" of the source code at www.freepbx.org, which I guess that means that it will be in 2.2?
Anyway, I downloaded the code changes and got it working from a command line. I added one tweak that you might want to consider: an FTPPORT parameter. I use oddball ports for FTP for security reasons. All I did was add FTPPORT to amportal.conf and modify the FTP command in ampbackup.pl like this:
# If $ftpport is left blank, it should just use the default port (21).
system ("ftp -n $ftpserver $ftpport < $ftpfile > /dev/null 2>&1");
Putting the port after the host on the ftp command is undocumented in the man page, so you might prefer to use the "open host [port]" command from inside the $ftpfile.
NOW, on to the burning question: this works brilliantly when I invoke the backup from the command line (logged in as user asterisk). But when I invoke it from the Backup screen inside FreePBX, whether as a Run Now job or a scheduled job, the ftp transfer doesn't happen. It doesn't even create the file in the /tmp directory.
Any idea what the problem might be? Is there a way to view the console output from the FreePBX so I can add some print statements to the Perl script and see what's going on?
Thanks for a great feature and for any help you can offer!
Mark
Well it would help if I was working on the running copy of the code, wouldn't it? I had been working in /usr/src/freepbx/amp_conf/bin/ampbackup.pl. Once I changed /var/lib/asterisk/bin/ampbackup.pl, the FTP works fine from the UI.
I'd still be curious how to "tap into" the console output if that's possible...
Cheers,
Mark
Sooo... this currently is the only way to have a complete backup as possible and quickly recover from a complete trixbox crash?
Does it also backup e.g. the TFTP directory?
the idea should be : to recover from a complete failure
install the current trixbox image on a (new) server, update trixbox
then restore the backup, then ready to go?
I guess not backed up is :
- sendmail config (yet, used by trixbox)
- tftp directory
- logs?
If you're referring to the partimage approach, anything that doesn't change could be part of your image. I would think that would include any config files.
The image is a snapshot of an entire partition (like a Norton Ghost image under Windows). The assumption is that you will restore to the SAME server (perhaps after replacing the failed hard drive), not a new server. If it IS a different server, it should have an identical hardware configuration to the first one.
When you do the restore, you do not install and update trixbox, you just restore the latest image (which brings you back to the point at which the image snapshot was made), then restore the latest trixbox/FreePBX backup.
I _think_ the FreePBX backup includes the call logs, but it would not include general system logs.
I'd suggest trying it on a test machine before relying on it in production!
Mark
The reference to a partimage approach may have been confusing. That approach, and some alternatives, are discussed in another thread.
Mark
I'm running FreePBX 2.2.0rc3 on a live system in addition to a new box we are migrating over to. We do an entire backup on the live system and copy this file to the new box and restore via the FreePBX GUI. Everything says ok. However the web gui does not reflect any of the restored settings. The .conf files are correct though. If you make any changes in the GUI and apply the changes all the files are overwritten back to prior to the restore.
I'm guessing that this happens because the files are rewritten from the db but how is it possible to make this work and have the restored settings reflected in the web gui and db?
I must be missing something here?
Hi: I am a complete dummy for this. I would like to Bakup/restore the entire Trixbox and all of the componets. I want To use an off site hard drive, which I use for (ghosting ) my entire hard drive in case of pure CRASH. Can someone spell this proceedure out ?
Maybe allow cut & paste with a little help. I am lost ,
Thanks you
RJLennon (trixbox learning )
RJLennon
I use Mondo. This allows you to make a full image of your drive and copy it onto cd's (2 cd-r's for TB2) . I have found Mondo easy to install, took me about 20 minutes. The backup may take an hour, depending on the speed of your machine. The images are copied to your hard drive and you can then copy them to a machine that has a CD burner. The cd's are bootable and will let you clone your system or do a bare metal recovery.
I have documented the process that I followed in a how-to here http://cat24.net/Mondoarchive.html
John
THANK-YOU : For the backup information. I will try to follow the link. I will get back to the post and let you everyone know what the my status is.
RJLennon
http://cat24.net/Mondoarchive.html
i installed mondo , well rather the Thomas Kings trix script , it is really easy to install , i set it to backup to CDR images and send to my FTP server . i burnt the CDRs (5) and cloned my production box on different hardware , mondo rescue has so many features for resizing disks and repartioning , absolutly fantastic ..this whole disk backup script is an absolute MUST have . it you need to restore your trixbox from a hacker or equipment failure
We had a CRASHED trixbox the other day, I felt a pinch, but then thanks to BackUp.
Whew, thanks to good ol' backup!
Here's what we normally do on a daily basis.
On our clients installations (only 6 of them), trixbox run a automated freePBX DAILY backup, believe me, yes DAILY backup at midnight. The file ranges from 30mb to 38mb. The backups goes to its own local HDD, and our maintenance guy then manually connects to each Trixboxes (remotely - remotely actually from the Philippines where it is daytime) and then manually picks up the backup file to copy to individual Mounted USB drives (2GB to 8GB sizes). Then manually again, copies each individual backup files into our office storage, where they are kept for more than 6 months now.
On a monthly basis, we do a mondo ala takingly (Thomas King's) mondo scripts. It works great!
So when that crashed trixbox happened the other day! Boy that saved our day! Well it still took about 45 minutes to restore. But it save us faces and save us frustrations, and client is happy, because they DID the CRASH! Somebody PULLED the RAID drive and mess around with it and crashed the system... aha!
BTW, the backup and restore feature of freePBX will ONLY WORK with the SAME versions. If you have trixbox 2.2, then restore it to 2.2 and NOT to 2.4 or 2.5. It may get funny results.
Just wanted to share our 'fun' experience.
This new ftp option for backup works GREAT!
I just have 2 suggestions.
1. Via the gui, could you make ftp an option there? This would be useful when you want to grab a snapshot backup but don't require it to be ftp'd up.
2. An option to retain x days, of backups on ftp, or retain 5 days local and erase the copy on the ftp server?
Short of that, this makes life much easier!
Trying to use a backup taken with the trixbox backup utility to restore may server
I've reloaded the server copied the tarball to /var/lib/trixbox/backups/daily
Then gone into the web gui selected Tools>backup
Clicked restore
NOTHING HAPPENS
System is setup Exactly as the one that crashed
I assume you have done the readings above as to how to go into the freepbx's Backup & Resotere module and what to backup or not or atleast be familiar with the module.
Here is the process to automatically backup files to a remote ftp machine:
1. Use a shell (SSH or Putty) to connect to your asterisk
a. From the shell do: nano /etc/amportal.conf
b. Scroll down half way, you’ll see comments about FTP something like below:
# The following are used to optionally have the freepbx backup program #optionally send the generated backup to an ftp server #FTPBACKUP=YES to enable FTPUSER, FTPPASSWORD, #FTPSERVER must be set FTPSUBDIR is an optional subdirectory at the #ftp server, it will cause ftp to do a cd. There is no error checking so you #should check to make sure these are set correctly. The ftp is saved after #the backup, so it will not cause the local backup file to be effected
FTPBACKUP=yes #Uncommented for backup to be ftped
FTPUSER=username on your ftp server #Uncommented
FTPPASSWORD=password on your ftp server #uncommented
#FTPSUBDIR=MyFTP
FTPSERVER=192.168.1.XX #uncommented for FTP to work
Now make sure the above lines are uncommented. Save by doing a ctrl-x then Y then enter to write to the same name.
c. I used filezilla free ftp server on my windows machine. On my windows machine I have created a directly something like: myasteriskbackup
d. I make this directly write enabled and created a username and password which I used in the above amportal.conf file
2. Now go back to the FREEPBX gui, Create Backup Schedule from Backup & Restore Module
a. For testing I created a BackupNow schedule with ‘Now’ selected from the Run Backup Now pulldown menu
b. Then I pressed the Submit Changes and it created the backup folder.
c. Now using shell again, you can go into /var/lib/asterisk/backups and you should see the folder or directory with the same name as your backup schedule name you have created earlier in freepbx – in my case it is ‘BackupNow’
d. Now go into the directory: cd BackupNow
e. You should see a file like: 20080208.17.30.24.tar.gz
f. The file name is basically the date and time it was created
3. Once you verified that everything is good then it’s time to restart your asterisk and upon restart it should transfer the file to your ftp server
a. From shell do this: amportal restart
b. It should restart and dump the file into the ftp drive.
Hope the above method helps and are as detials as I could make it. But feel free to write me at pbx at doyel dot ca
Check this link out, there is a bug in backup restore method in tribox:
http://www.trixbox.org/forums/trixbox-forums/help/fix-freepbx-bac...
I think the problem you are having could be related to this. If not clarify what do you mean by no links?

Member Since:
2006-06-13