Backup and Restore issue with trunks

This is a new topic, following up on topic:
I thought I had the same issue as StaceyB but apparently I hadn’t.

As allready discussed in other topic with mbrevda, I’m mising some functionality in the Backup and Restore module.

I have 2 servers, 1 is active and 1 is standby in case something happens with the first one. I cannot have them share the same trunk because my provider only accepts registration from 1 IP at a time. When doing a backup and restore, having the trunk disabled on the standby server is not an option because how can you enable it when the primary server goes down? (manually yes but not automaticly)

So an other option is to register a different trunk on the standby server (that trunk is a failover from the other trunk) but when doing a restore FreePBX copies the sip_additional.conf file which includes not only extension data but also trunk data (this is the part I think should be changed). When it restores this file all trunk data is messed up and the standby server has become useless.

How I currently handle the backup and restore:

I exclude the following mysql tables:

I run a post-restore hook:
It runs a shellscript that replaces part of the sip_additional.conf file (at the moment it also replaces part of the sip_registrations.conf file but i’m not sure if this is correct, let me have a look at that).
This script also replaces mysql data in the sip table.

Checked the following options:
Restore Here
Apply Configs

I’m using:
Asterisk 1.8
FreePBX 2.10
Backup & Restore module

In my configuration: each server has 1 trunk (same DID but different name, username and password).
If there was a way to exclude the trunk settings from being restored it would be ok.
A possible solution for this would be if trunk settings would be stored seperately from extension settings. For example: not store trunk settings in the sip_additional.conf file but in some file called trunk_additional.conf.
And not store some of the trunk settings in the mysql table “sip” but store all settings related to trunk in the table “trunks”.

Offcourse there are other things related to trunk settings like outbound routes
but they are easily to exclude in the current version

There is no simple way to do what you want. That is what we designed the pre/post scripts for.

I can fully understand that. The new backup and restore module (since 2.10) is a big improvement when comparing to the older versions so don’t get me wrong there.
But it is still very hard to accomplish failover/redundancy with FreePBX on trunk level.

Thanks for the help (also on IRC).

James83, I am very interested in your script. Would you be willing to share it? I would like to see how you accomplish this as I am trying to accomplish the same thing.

James83, it would be nice if you could post your script here for other people to see.