Restore backup file failure

Hi, this is my first post, so here’s hoping for a solution to my problem.

I have been running FreePBX on a Raspberry Pi with an 8GB SD card with backups being stored on an extenal USB drive. The card has been corrupted following a power failure and I have reinstalled FreePBX. However I am unable to restore the backup file from the GUI. I have run restore.php from the command line (backup file on mounted USB drive) and get the error “Nothing to restore”. When I run restore.php with the --manifest argument instead of --restore, I get the following output:

    [fpbx_db] => mysql-3
    [fpbx_cdrdb] => mysql-4
    [name] => MyFreePBX_backup
    [ctime] => 1436929203
    [hooks] => Array
            [pre_backup] => /etc/mount-usbdrive
            [post_backup] => /etc/unmount-usbdrive
            [pre_restore] =>
            [post_restore] => /etc/unmount-usbdrive

    [pbx_framework_version] =>
    [backup_version] =>
    [pbx_version] => 2.11.0
    [file_list] => Array
            [etc] => Array
                    [asterisk] => Array
                            [0] => adsi.conf
                            [1] => agents.conf
                            [2] => ais.conf
                            [3] => alarmreceiver.conf

The above is only the first few lines of the output but everything appears to be in the backup file.

Here is the code where the error is given:

//do restore
if (isset($vars['restore'], $vars['items'])) {
	$items = unserialize(base64_decode($vars['items']));
	if (!$items) {
		backup_log(_('Nothing to restore!'));

so why is $items null when --manifest argument shows the backup file contents?

I had a similar problem with my Raspberry Pi distro. I can’t provide you with an answer as to why if $items is null, why the back up contents show, but the way to restore your backup is to copy the backup file to
/var/spool/asterisk/backup and then use the backup/restore in the GUI to restore it selecting local server.

In my issue, the http upload simply did not work to restore the backup file.

Hope I helped.



Thank you John, that worked!

Best regards,

Glad I helped! :smile: