id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	confirmation	distro	engine	distro_ver	engine_version	svn_rev
4476	Backup to work with primary and secondary systems	peterbokunet	mbrevda	Below is a diff to patch to the backup module.  During a restore it will update the trunks table setting trunks defined as "pri" to off and trunks defined as "bak" to on.\r\n\r\n{{{\r\n--- backup.orig/functions.inc.php_2010-06-22 21:15:04.000000000 -0500\r\n+++ backup/functions.inc.php_2010-07-28 15:19:18.000000000 -0500\r\n@@ -163,6 +163,13 @@ function backup_restore_tar($dir="", $fi\r\n ___$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asterisk.sql 2>&1";\r\n ___exec($sql_cmd,$out_arr,$ret);\r\n       backup_errors($error_cause, $ret, _('failed to untar asterisk.sql'));\r\n+___$sql_cmd="echo \\"UPDATE trunks SET disabled = 'off' WHERE disabled = 'pri'\\" | mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']. " ".$amp_conf['AMPDBNAME']." 2>&1";\r\n+___exec($sql_cmd,$out_arr,$ret);\r\n+      backup_errors($error_cause, $ret, _('failed to update trunks pri to off'));\r\n+___$sql_cmd="echo \\"UPDATE trunks SET disabled = 'on' WHERE disabled = 'bak'\\" | mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']. " ".$amp_conf['AMPDBNAME']." 2>&1";\r\n+___exec($sql_cmd,$out_arr,$ret);\r\n+      backup_errors($error_cause, $ret, _('failed to update trunks bak to on'));\r\n+\r\n ___$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asteriskcdr.sql 2>&1";\r\n ___exec($sql_cmd,$out_arr,$ret);\r\n       backup_errors($error_cause, $ret, _('failed to restore asteriskcdr.sql'));\r\n}}}\r\n\r\nHow the values get populated [in core] or handled on the primary are not addressed in this patch.  \r\n\r\nDiscussion about this patch may be done in the forum under http://www.freepbx.org/forum/freepbx/development/managing-trunk-state-with-backup-restore\r\n	Feature Requests	closed	minor	2.10	Backup & Restore	2.8-branch	invalid	Backup Restore Primary Backup		Unreviewed		All			
