SOLVED-FreePBX 2.8 backup module - how to use for remote restore?

FreePBX 2.8 backup module - how to use for remote restore ?

I set up two hardware boxes with the latest 2.8 svn and then created keys so I could ssh from the “production” box to the “standby” box with out a password.

Then I setup the “production” box as such

Remote SSH Hostname = 192.168.XXX.XXX
Remote SSH User = root
Remote SSH Key = /root/.ssh/id_rsa.pub

On the “standby” box, I created a backup set with the same name as the primary set and checked the “Restore to this server” button.

Nothing seems to happen when I trigger a “now” update from the primary.

I am not really clear if that is the right direction ? Should I have the “standby” box pulling the backup files down ? Or does the “production” box push the files ?

SOLUTION

As it turns out, the BackUp box “pulls” the backup from the Production system. Here is a list of where else I was off the mark… during testing I loaded a current AsteriskNow 1.5 system and then used svn to load FreePBX 2.8.

  1. amportal.conf must be identical on both systems. I had not touched any passwords in amportal.conf and that was an issue.

  2. AsteriskNow 1.5 has a few issues out of the gate that I did not address ( I know to, but I was testing an otherwise stock system) So, to proceed I fixed the first few common issues with:

Fix CDR:

yum install asterisk14-addons.i386 ncurses-devel.i386 php-gd
chown -R asterisk /var/lib/php/session
service httpd restart

##Fix Uploads and PHP Memory notices:

sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf
sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf
echo "memory_limit = 100M" > /etc/php.d/freepbx.ini
echo "upload_max_filesize = 20M" >> /etc/php.d/freepbx.ini
service httpd restart 
  1. I figured if I did a key exchange the way I usually do it… using root… that I would be fine… Not so, the proper way in this instance would be to use:
sudo -u asterisk ssh-keygen

and then

sudo -u asterisk ssh-copy-id -i /var/lib/asterisk/.ssh/id_rsa.pub root@<production_box.ip>

On the BackUp system I set up the Remote Backup Options as:

Remote SSH Hostname = <production_box.ip>
Remote SSH User = root
Remote SSH Key = /var/lib/asterisk/.ssh/id_rsa

and checked the “Restore to this server” button.

I then chose to run the backup now and hit the “Submit Changes” button and off it went. Very nice…

I also added the /var/lib/asterisk/licenses/ directory to get backed up. The license files for SkypeForAsterisk, FAXForAsterisk and G729 live there. While they did get moved correctly, I am sure they would not work as the MAC addresses would not match…But, I least I got them. I wonder about cloning the MAC on restore ?

At any rate, nice job. This is an excellent addition to the backup and restore module.

cosmicwombat - its works the other way around. The backup server PULLS the backups - and the only server to configure is the backup server. There will be a blog post about this going live in the next 24 hrs.

Thanks Moshe, and here is a link to that blog entry:

http://www.freepbx.org/news/2010-05-30/high-availability-backup-and-restore