FYI FreePBX 15 Restore Module

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,079
Reaction score
2,601
Hope somebody will update backup to current version 13.0.27.23 on their 13-13 server and make a final stab at this. It may very well be that they updated some code on the FreePBX 13 platform to support the FreePBX 15 restore. Our 13.0.27.21 version of backup on the 13-13 platform is close to two years old. If that fixes it, I will push out a backup update to everyone running 13-13.10.
 

kenn10

A lesser geek
Joined
Dec 16, 2007
Messages
925
Reaction score
166
Updated backup module on my production 13-13.10 system. Will backup system and try restoring on 16-15.1 again.
 

kenn10

A lesser geek
Joined
Dec 16, 2007
Messages
925
Reaction score
166
Nope. Same error.

  1. Updated FreePBX 13 backup module to 13.0.27.23.
  2. Restarted system with fwconsole restart
  3. Ran a full backup using backup module
  4. Copied backup to my Windows desktop using WinSCP
  5. Surfed to my test Incredible-16-15.1 system.
  6. Went to Backup --> restore screen and chose the upload backup option
  7. Ran the restore. It showed it as a legacy backup. The following is the result.

Code:
Running with: /usr/sbin/fwconsole backup --restore='/var/spool/asterisk/backup/uploads/20190723-145016-1563907816-13.0.195.28-1880652570.tgz' --transaction='957f7cb8-8ff0-4ece-80d8-12e73ece9f70'
Determining backup file type...type is legacy
Starting restore job with file: /var/spool/asterisk/backup/uploads/20190723-145016-1563907816-13.0.195.28-1880652570.tgz
Extracting backup...
Backup extracted to /tmp/backup/957f7cb8-8ff0-4ece-80d8-12e73ece9f70. These files will remain until a new restore is run or until cleaned manually.
Loading manifest to memory
Loading astdb to memory
Parsing out SQL tables. This may take a moment depending on backup size.
Found 2 database files in the backup.
File named: /tmp/backup/957f7cb8-8ff0-4ece-80d8-12e73ece9f70/mysql-2.sql.gz
Detected file /tmp/backup/957f7cb8-8ff0-4ece-80d8-12e73ece9f70/mysql-2.sql.gz as the PBX (Asterisk) database. Attempting restore
Extracting supplied database file mysql-2.sql.gz
Loading supplied database file mysql-2.sql
SQLSTATE[HY000]: General error: 1 near "COMMENT": syntax error
 
Last edited:
  • Sad
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,079
Reaction score
2,601
I'm wondering if this could be because the FreePBX folks run MySQL with no root password?? Try this and then you can set it back if it works:
Code:
mysqladmin -u root -ppassw0rd password ''
# to set it back
mysqladmin -u root -p password 'passw0rd'
# and press ENTER at the password prompt
 

kenn10

A lesser geek
Joined
Dec 16, 2007
Messages
925
Reaction score
166
I'm wondering if this could be because the FreePBX folks run MySQL with no root password?? Try this and then you can set it back if it works:
Code:
mysqladmin -u root -ppassw0rd password ''
# to set it back
mysqladmin -u root -p password 'passw0rd'
# and press ENTER at the password prompt
I did it on the Incredible-16-15.1 system but no dice. Same error.

By the way, my IncrediblePBX 13.13.10 system is fresh from about 2 weeks ago. My VM got trashed and I had to rebuild then do an Incredible Restore. My test Incredible 16.15.1 is a fresh install as of three days ago.
 
Last edited:
Joined
Oct 26, 2013
Messages
60
Reaction score
22
It could be one of the primary features, but as a test, I built a FreePBX 14 system using the Sagnoma stable distro. Got it up and running, restored a FreePBX 14 backup file to the new system to establish trunks, etc. Made a backup of this FreePBX 14 system running the Sagnoma stable distro.

I then updated it online to FreePBX 15 using their PBX Upgrader. Now I deleted the trunks, inbound, and outbound routes.

Then I did a restore on this FreePBX 15 system using the FreePBX 14 backup file and it worked, no SQL errors in the mysql-2.mysql file.

Bottom line, it works using their distro, but it does not when manually installing FreePBX on top of your own machine.
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
505
Reaction score
209
Bottom line, it works using their distro, but it does not when manually installing FreePBX on top of your own machine.
Hard to make a blanket statement with a moving target. 13 and 14 are both stated targets for the 15 restore feature, but that doesn't mean they both work at this point.

Have you tried the v14 distro backup with the ipbx v15 restore?

Are the module version numbers the same?
 
Joined
Oct 26, 2013
Messages
60
Reaction score
22
I think I have found the fix. Let some others give this a try and report back here. You need to install mongodb-server package. It didn't require any configuration other than enabling it. Give this a try:

Code:
yum -y install mongodb-server sqlite-2

systemctl enable mongod
systemctl start mongod
Then perhaps reboot, but I would try it first, before rebooting. Please report back here your results...
 
  • Like
Reactions: wardmundy
Joined
Oct 26, 2013
Messages
60
Reaction score
22
Hard to make a blanket statement with a moving target. 13 and 14 are both stated targets for the 15 restore feature, but that doesn't mean they both work at this point.

Have you tried the v14 distro backup with the ipbx v15 restore?

Are the module version numbers the same?
Jerm, I guess the point of my post was that the restore worked on FreePBX 15 using the backup file from another version, when using the Sagnoma FreePBX distro, SNG7-PBX-64bit-1904. However, it did not work if you installed your own OS, such as CentOS 7 and then manually installed FreePBX. Anyway, I believe I found the fix as I posted above.
 
  • Like
Reactions: wardmundy

billsimon

Experienced in Asterisk, FreePBX, and SIP
Joined
Jan 2, 2011
Messages
947
Reaction score
294
The FreePBX team seems to be actively working on backup/restore 15 and there are several open issues for it. (20291, 20292, 20293) This would be a good time to submit bug reports, as well as be aware that there are known bugs with restoring legacy backups.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,079
Reaction score
2,601
Jerm, I guess the point of my post was that the restore worked on FreePBX 15 using the backup file from another version, when using the Sagnoma FreePBX distro, SNG7-PBX-64bit-1904. However, it did not work if you installed your own OS, such as CentOS 7 and then manually installed FreePBX. Anyway, I believe I found the fix as I posted above.
A new twist on (job) security through obscurity. Good find, @David Foxworth. We've updated the 16-15 installer.
 
Joined
Oct 26, 2013
Messages
60
Reaction score
22
Something else of interest that I ran across in restoring from a file was when attempting to upload the file to restore from. The size of the backup file I used was about 61Mb in size. However, by default in the php.ini file, the max size allowed is 8Mb. Change the post_max_size = 130M, or any appropriate size based on your backup file.

Code:
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 8M
 

kenn10

A lesser geek
Joined
Dec 16, 2007
Messages
925
Reaction score
166
Something else of interest that I ran across in restoring from a file was when attempting to upload the file to restore from. The size of the backup file I used was about 61Mb in size. However, by default in the php.ini file, the max size allowed is 8Mb. Change the post_max_size = 130M, or any appropriate size based on your backup file.

Code:
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 8M
Applying both suggest fixes above (I set post_max_size=0 to disable limit) to my Incredbile 16-15.1 system made no difference in a successful restore of the Incredible 13-13.10 backup. Still fails. :confused:

Code:
Running with: /usr/sbin/fwconsole backup --restore='/var/spool/asterisk/backup/uploads/20190723-145016-1563907816-13.0.195.28-1880652570.tgz' --transaction='cd8160e8-41aa-4d68-bf25-0f146a91c2e7'
Determining backup file type...type is legacy
Starting restore job with file: /var/spool/asterisk/backup/uploads/20190723-145016-1563907816-13.0.195.28-1880652570.tgz
Extracting backup...
Backup extracted to /tmp/backup/cd8160e8-41aa-4d68-bf25-0f146a91c2e7. These files will remain until a new restore is run or until cleaned manually.
Loading manifest to memory
Loading astdb to memory
Parsing out SQL tables. This may take a moment depending on backup size.
Found 2 database files in the backup.
File named: /tmp/backup/cd8160e8-41aa-4d68-bf25-0f146a91c2e7/mysql-2.sql.gz
Detected file /tmp/backup/cd8160e8-41aa-4d68-bf25-0f146a91c2e7/mysql-2.sql.gz as the PBX (Asterisk) database. Attempting restore
Extracting supplied database file mysql-2.sql.gz
Loading supplied database file mysql-2.sql
SQLSTATE[HY000]: General error: 1 near "COMMENT": syntax error
 
Joined
Oct 26, 2013
Messages
60
Reaction score
22
Hi kenn10,

Sorry to hear that it didn't work for you. My backup file was from FreePBX 14 restoring onto a FreePBX 15 system. My only other suggestion here would be to make sure that the mongodb is running and you might install these packages (you may have some already installed):

Code:
yum -y install sqlite2 php56w-odbc php56w-mbstring php56w-pecl-igbinary php56w-process php56w-gd php56w-bcmath mongodb-server
For reference, here is the list of PHP packages I found installed on the FreePBX distro:
Code:
php56w-pdo-5.6.40-1.sng7.x86_64
php56w-cli-5.6.40-1.sng7.x86_64
php56w-mysql-5.6.40-1.sng7.x86_64
php56w-bcmath-5.6.40-1.sng7.x86_64
php56w-5.6.40-1.sng7.x86_64
php56w-pecl-ssh2-0.13-1.sng7.x86_64
php56w-common-5.6.40-1.sng7.x86_64
php56w-soap-5.6.40-1.sng7.x86_64
php56w-xml-5.6.40-1.sng7.x86_64
php56w-pear-1.10.1-1.w7.noarch
php56w-pecl-igbinary-1.2.1-2.w7.x86_64
php56w-odbc-5.6.40-1.sng7.x86_64
php56w-ldap-5.6.40-1.sng7.x86_64
php56w-gd-5.6.40-1.sng7.x86_64
php56w-intl-5.6.40-1.sng7.x86_64
php-digium_register-4.0-1.sng7.x86_64
php56w-process-5.6.40-1.sng7.x86_64
php56w-pecl-redis-2.2.7-1.w7.x86_64
php56w-mbstring-5.6.40-1.sng7.x86_64
Otherwise, my only suggestion here would be to follow Bill's suggestion above and file a bug report...
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,079
Reaction score
2,601
If you're running Incredible PBX 16-15, the command to get everything would be...

Code:
yum install sqlite2 php-odbc php-mbstring php-pecl-igbinary php-process php-gd php-bcmath mongodb-server php-soap php-ldap php-intl php-pecl-redis
Or you can just rerun the newbackup16-15 installer:

Code:
cd /root
wget http://incrediblepbx.com/newbackup16-15.tar.gz
tar zxvf newbackup16-15.tar.gz
rm -f newbackup16-15.tar.gz
./install-backup
It's also been added to the base install now. Thanks, @David Foxworth.
 
Last edited:
  • Like
Reactions: David Foxworth

hawk#1

Member
Joined
Nov 3, 2015
Messages
71
Reaction score
24
Thanks wardmundy. I just reran the newbackup16-15 installer:
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,079
Reaction score
2,601
Looks like we're still missing some required pieces:

Code:
[2019-Jul-26 05:26:01] [freepbx.INFO]: Redis enabled but not running, falling back to filesystem [Redis::connect(): connect() failed: Connection refused]. Either fix Redis or remove the php redis extension [] []
Trying this:
Code:
yum -y install redis
systemctl restart redis
systemctl enable redis
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,079
Reaction score
2,601
Still no cigar. No docs and no logs makes this a little painful.
 

Members online

No members online now.

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,319
Messages
137,010
Members
14,549
Latest member
mawa1213