Backup and Restore

techieg
Posts: 279
Member Since:
2006-06-13

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.



kerryg
Posts: 6790
Member Since:
2006-05-31
Re: Backup and Restore

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

--

Kerry Garrison
http://www.VoipStore.com - http://3cxbook.com
(888) VOIPSTORE - (888) 864-7786



TROFFASKY
Posts: 78
Member Since:
2006-06-03
Re: Backup and Restore

Being able to upload a tarball of a saved backup through a form in a web page would be handy.



philippel
Posts: 700
Member Since:
2006-05-31
Re: Backup and Restore

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

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Apr 27-29, Huntsville, AL



dean.collins
Posts: 139
Member Since:
2006-06-01
Re: Backup and Restore

can you explain this again?

I'm using trixbox 1.1.1 and I cant find it.

is there somewhere specific in the folder that it stores these backups as I can just use winscp to log in but I dont know what files to copy across.

Dean

--

Cheers,
Dean Collins
www.Cognation.net
Delivering Your Solutions Now.



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Backup and Restore

Under AAH Freepbx it is
/var/lib/asterisk/backups



dean.collins
Posts: 139
Member Since:
2006-06-01
Re: Backup and Restore

sweet thanks, that was easy.

--

Cheers,
Dean Collins
www.Cognation.net
Delivering Your Solutions Now.



nc_mark
Posts: 135
Member Since:
2006-06-03
Re: Backup and Restore

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)

Quote:
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



nc_mark
Posts: 135
Member Since:
2006-06-03
Re: Backup and Restore

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)

Quote:
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



SyscomDT
Posts: 5
Member Since:
2006-07-27
Re: Backup and Restore

I also am looking for this feature. Could someone knowledgeable post a method to reliably backup the freepbx configuration so that it can be restored to a fresh installation? Thanks for your help,
-Scott

--

CEO/Consultant
Syscom Digital Technologies, LLC.
Missoula, MT
www.syscomdt.com



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Backup and Restore

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



Greg25c
Posts: 2
Member Since:
2006-08-17
Re: Backup and Restore

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



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Backup and Restore

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/



Greg25c
Posts: 2
Member Since:
2006-08-17
Re: Backup and Restore

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



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Backup and Restore

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.



mcbsys
Posts: 38
Member Since:
2006-08-02
Re: Backup and Restore

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 /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



mcbsys
Posts: 38
Member Since:
2006-08-02
Re: Backup and Restore

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



lightningbit
Posts: 11
Member Since:
2006-10-05
Re: Backup and Restore

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?



mcbsys
Posts: 38
Member Since:
2006-08-02
Re: Backup and Restore

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



mcbsys
Posts: 38
Member Since:
2006-08-02
Re: Backup and Restore

The reference to a partimage approach may have been confusing. That approach, and some alternatives, are discussed in another thread.

Mark



magentasol
Posts: 3
Member Since:
2007-03-01
Restore overwritten after apply settings in AMP

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?



RJLennon
Posts: 111
Member Since:
2006-09-22
Backup? Restore?

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 )



percykwong
Posts: 758
Member Since:
2007-04-30
add a second drive do a dd

add a second drive do a dd to the other drive and it's a perfect copy

--

-----------------------------------------------
Percy Kwong
Trixbox Tech Support - 202.600.3884

Swimminginthought.com



anchor85
Posts: 678
Member Since:
2006-06-07
Backup / Image Hard disk with Mondo

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

--

John
Cat24.net



RJLennon
Posts: 111
Member Since:
2006-09-22
BACKUP / IMAGE HARD disk with Mondo

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



ddwyer
Posts: 401
Member Since:
2006-06-03
mondo ROCKS!

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



rklein
Posts: 2
Member Since:
2007-02-21
copy command

Hi,

If I am in the backup directory what is the command that will copy the desired backup to the desttop of my PC?

Thanks,

Raymond



rklein
Posts: 2
Member Since:
2007-02-21
copy command

Hi,

If I am in the backup directory what is the command that will copy the desired backup to the desttop of my PC?

Thanks,

Raymond



anchor85
Posts: 678
Member Since:
2006-06-07
Copy to PC

I run winSCP on my PC and use that to copy from my trixbox m/c.

--

John
Cat24.net



datu503
Posts: 261
Member Since:
2007-06-06
BackUp BackUp BackUp

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.

--

Walden, Certified FtoCC Admin & Tech
www.tech-r-us.com everythingIP
www.citivoip.com everythingVOIP



jmccookeidpass
Posts: 1
Member Since:
2007-11-24
am losT i need help BACKUP AND RESTORE TRIXbox

what can i do, i need help in backing up and restoring trixbox can anyone help me plz



kspare
Posts: 673
Member Since:
2007-02-16
This new ftp option for

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!



kspare
Posts: 673
Member Since:
2007-02-16
Where are the logs for the

Where are the logs for the freepbx backup stored? I've got a brand new system that won't do any backups right now.



bdis
Posts: 111
Member Since:
2007-01-04
Trying to use a backup taken

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



kimkhan
Posts: 96
Member Since:
2007-03-07
Detailed method of Backing Up your trixbox to a FTP machine

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



advnet
Posts: 20
Member Since:
2008-03-30
no backup/restore link anymore

I have done above steps for backing up my data. Reload Trixbox, and now in freepbx, there is no backup/restore link anymore. I have edited amportal.conf, to enable FTPBackup already

Is there any idea to restore data now?
Thank you.



kimkhan
Posts: 96
Member Since:
2007-03-07
There is a bug

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?



zombie
Posts: 3
Member Since:
2008-07-15
Where is the Backup/Restore utility?

My trixbox version is v2.6.0.0 and the FreePBX 2.4.0 is included.
but I can't found the Backup/Restore menu on the web.
do i need to install some extra module manully? and how to do ? many thanks!



cbrickner
Posts: 188
Member Since:
2008-07-18
Within FreePBX, goto Module

Within FreePBX, goto Module Admin -> Check for updates online.
Scroll down to Backup Restore and install.

Remember to be careful if you are restoring from an older FreePBX version.

--

Charles Brickner
trixbox CE Support Engineer

trixbox.org/support



Daniel-Compuking
Posts: 30
Member Since:
2008-11-03
How to back up

How I do a backup in the first place?
Where do I start, where are these settings in trixbox?
Please help!
I'm new to trixbox, have figured out almost everything except for backup



georgemason
Posts: 38
Member Since:
2008-05-22
Does anybody use SSH backup in Trixbox??

I've read this thread from top to bottom but can't see much about SSH - does anyone use SSH to backup their Trixboxes, if so, mind sharing some thoughts?

I was planning to SSH the backups to our CentOS server although am having some trouble installing the SSH key. I have created a user on the server, installed the Trixbox's public RSA key on the server and am trying to get the backup to work (it doesn't).

If anyone has this working I'd be interested to hear what you did to make it so.

Thanks. George



bull_tpk
Posts: 58
Member Since:
2007-06-23
Soory If I am dumb, I have

Soory If I am dumb, I have been working with free pbx admin for some time, but never installed a system from scratch, I have just installed 2.6.2.3. All good no probs, but I cant see backup and restore, and there doesnt seem to be an option to update from modules?

How do I make it an option?

Thanks



dbaddorf
Posts: 93
Member Since:
2009-08-06
Backup for 2.6.2.3

See post: http://www.trixbox.org/forums/trixbox-forums/open-discussion/back... for a step-by-step installation of the FreePBX and Mondorescue backups for trixbox 2.6.2.3...



bull_tpk
Posts: 58
Member Since:
2007-06-23
Thank I will look at that.

Thank I will look at that.



bull_tpk
Posts: 58
Member Since:
2007-06-23
Sorry to be dumb again, but

Sorry to be dumb again, but isnt on the install disk, or why doesnt it appear as a module update option?



dbaddorf
Posts: 93
Member Since:
2009-08-06
external module

If I understand your question correctly (which I may not), it's not included in the list of modules because it is an external module written by the FreePBX development team, not by the trixbox development team. trixbox uses their own fork of FreePBX...



bull_tpk
Posts: 58
Member Since:
2007-06-23
Gotcha. Now I understand.

Gotcha. Now I understand. Sorry I am new to this



bull_tpk
Posts: 58
Member Since:
2007-06-23
Gotcha. Now I understand.

Gotcha. Now I understand. Sorry I am new to this



zigg.z
Posts: 56
Member Since:
2009-08-20
Automatic Backup to thumb drive nightly or weekly

Is there a way to set the backup tools to do automatic backups to a thumb drive making an ISO bootable image?
Then you would have a robust system that does not need a lot of tending, but in the event of hardware failure you can boot to USB device?

If someone can help me out here this would be very well appreciated!



staple
Posts: 3
Member Since:
2010-03-29
Problem with FTP

I have setup the FTP backup and it connects well, establishes a back file in the FTP server directory then stops and reports it did not work. The file on the FTP server is 0 bytes.

I have iptables installed and I am wondering if it is something to do with my rules. I haven't however got any concerning ports 20 or 21

Any advice appreciated.

Gwilym
-------------
www.staple.co.nz

--

-------------
www.staple.co.nz



cdsJerryw
Posts: 51
Member Since:
2009-02-17
I do backups with the FTP

I do backups with the FTP but I've read so many threads here where people were unable to restore their backup files to an updated version of Trixbox. Phones are critical to business operations and hard drives are cheap. I took our system down long enough to clone the drive. I keep the spare drive inside the phone system case, but not connected. If the drive dies I can simply insert the new drive and I'm running again. If the rest of the system dies and the hardware changes I may not be so lucky as I don't know how picky Trixbox is about the hardware it's installed on, but at least I've got SOME hope because you KNOW it's just a matter of time before a hard drive pukes. I'm fixing three drives that died on other servers today. None of them are very old. Hard drives just aren't dependable.



mat123
Posts: 1
Member Since:
2010-04-26
Back up to another trixbox

Hello Everyone,

Its my 2nd day using trixbox and i am asked to create a backup plan on 2 trixboxes
one runing and another just backup for the conf files, incase the first one crashes just transfare the network cable and the ip and continue
am new to linux and i need major help :(
I tam tring to follow this
http://www.mohdshakir.net/2007/10/09/automate-rsync

Please Advice



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.