Trying to use the Backup & Restore to restore a FreePBX configuration with only a few modules worth of data. Getting the following error in the output
Running with: /usr/sbin/fwconsole backup --restore='/var/spool/asterisk/backup/uploads/Blank.tar.gz' --transaction='b232017b-fe27-4810-a8e8-f3c22d9d5dbf'
Determining backup file type...type is current
Starting restore job with file: /var/spool/asterisk/backup/uploads/Blank.tar.gz
Extracting Backup
Extracting backup...
Processing core
Resetting core module data
Dropping table trunks...Done
Dropping table pjsip...Done
Dropping table sip...Done
Dropping table dahdi...Done
Dropping table iax...Done
Dropping table indications_zonelist...Done
Dropping table devices...Done
Dropping table users...Done
Dropping table incoming...Done
Dropping table dahdichandids...Done
Dropping table outbound_route_patterns...Done
Dropping table outbound_route_sequence...Done
Dropping table outbound_route_trunks...Done
Dropping table outbound_routes...Done
Dropping table outbound_route_email...Done
Dropping table trunk_dialpatterns...Done
Updating tables trunks, pjsip, sip, dahdi, iax, indications_zonelist, devices, users, incoming, dahdichandids, outbound_route_patterns, outbound_route_sequence, outbound_route_trunks, outbound_routes, outbound_route_email, trunk_dialpatterns...Done
Adding emergencydevices table..Done
Migrating pickup groups to named pickup groups
Migrating call groups to named call groups
Checking for possibly invalid emergency caller id fields..none found
Migrating old media encryption values...done
Removing encoding on incoming routes alertinfo values...done
Generating CSS...Done
Restoring from core [FreePBX\modules\Core\Restore]
Processing Ampusers
Processing Astmodules
Processing Dahdichannels
Processing Devices
Processing Did
Processing Routing
Processing Trunks
Processing Users
Importing KVStore from core
Importing Feature Codes from core
Done
Processing backup
Resetting backup module data
Generating CSS...Done
Restoring from backup [FreePBX\modules\Backup\Restore]
Importing KVStore from backup
Done
Processing dashboard
The module dashboard does not seem to support restores.
Processing filestore
Resetting filestore module data
Generating CSS...Done
Restoring from filestore [FreePBX\modules\Filestore\Restore]
Importing KVStore from filestore
Done
Processing sipsettings
Resetting sipsettings module data
Dropping table sipsettings...Done
Updating tables sipsettings...Done
New SIPSettings installation detected. Initializing default settings
populating default codecs..ulaw, alaw, gsm, g726 added
Updating kvstore_Sipsettings
Migrating Audio Codecs
Generating CSS...Done
Restoring from sipsettings [FreePBX\modules\Sipsettings\Restore]
Done
Processing userman
Resetting userman module data
Remove all User Management tables
Dropping table userman_users...Done
Dropping table userman_users_settings...Done
Dropping table userman_groups...Done
Dropping table userman_groups_settings...Done
Dropping table userman_directories...Done
Updating tables userman_users, userman_users_settings, userman_groups, userman_groups_settings, userman_directories...Done
Generating CSS...Done
Restoring from userman [FreePBX\modules\Userman\Restore]
Cleaning table: userman_directories
Cleaning table: userman_groups
Cleaning table: userman_groups_settings
Cleaning table: userman_users
Cleaning table: userman_users_settings
Done
Restore processing for modules are finished successfully
In json_decode.php line 7:
Syntax error
backup [--backup BACKUP] [--externbackup EXTERNBACKUP] [--dumpextern DUMPEXTERN] [--transaction TRANSACTION] [--list] [--warmspare] [--implemented] [--filestore FILESTORE] [--restore RESTORE] [--restorelegacycdr] [--modules MODULES] [--restoresingle RESTORESINGLE] [--backupsingle BACKUPSINGLE] [--singlesaveto SINGLESAVETO] [--b64import B64IMPORT] [--fallback] [--useinfiledb] [--skiprestorehooks]
Attaching the Backup file as well (renamed the extension from .tar.gz tp .tgz) Blank.tar.tgz (5.8 KB)
It seems like the restore was successful, refreshing the GUI shows the “Apply Config” button and I can see the configuration was restored as well. Why the error?
I yearn for the day when we can finally move beyond php v5.6. We tried to write a custom module a while back (the details of which are moot at this point) but found that we would have absolutely required v7.x to accomplish what we wanted…the libraries we needed just weren’t available/backport-able under v5.x.
@dicko, while short on the specifics, is correct…there’s still a bit of code left in v15 that is dependent on php v5.6. Granted, the biggest thing holding us back from moving to v7.x is Zend, but I digress.
That said, you might be better off firing up another FreePBX system built and installed with php v5.6 from the start (Official Distro version, perhaps?) and restore all your config/data there. We’ve gone down the rabbit hole of trying to switch a system from php v7.x to v5.6 and, well, it’s an absolute nightmare. Not impossible, but you’ll be fixing dependency mismatches and endless loops of “you have to install/uninstall this before that” until your eyes glaze over and you feel like you’re about to slip into a coma. It’s not for the faint of heart, especially on a production server.
I saw on another forum where folks were having problems with FreePBX on CentOS 8 due to Node.js version compatibility. So you may have to downgrade that component too.
I edited the /var/www/html/admin/modules/backup/Json/json_decode.php and logged the $data value which the json library was trying to decode when throwing the exception. Below is the update json_decode.php (pardon my rusty PHP)
Anything that can be looked at here? Kind of an important thing since even a fresh install backup is failing to restore on the same box that generated the backup.
I modified the json_decode.php to get around it but doesn’t mean that it should be done that way. The question is, why is the above error thrown in the first place?
Also, when the above error is thrown, it looks like the restore process just stops and doesn’t proceed further with the rest of the stuff.