Unable to restore server

After a support tech messed up the config on my server it needs to be restored with one of the monthly backups but the GUI is not working and I’m unsure on how to restore it on the CLI. Any ideas?

What version are you running?
Is the UI giving some sort of error in general? How exactly is it messed up?

Its running FreePBX 15.0.17.68. Asterisk won’t run so the error is “Can not connect to Asterisk”. The CLI barely runs.

The restore command is

fwconsole backup --restore [/path/to/restore-xxxxxx.tar.gz]

I would also make sure asterisk is running: asterisk -r

Make sure it is running as the asterisk user: ps aux | grep asterisk
you should see something like:

asterisk  2271  0.9  0.7 2211888 59232 ?       Sl   11:01   3:28 /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c

The first field is the user. If this is running as root run

fwconsole stop
fwconsole start

Okay so it says it is running in the CLI but has a bunch of errors. Now when I do the restore I’m unsure as to where the location of the backups are stored on the drive. How would I find that please.

Also. I did the fwconsole stop fwconsole start, thing and unfortunately it didn’t help :frowning:

Does it happen to be /var/lib/asterisk/backups/? I just keep getting the error that file cant be found. Im assuming that the XXXXXX in your example is the backup name.

from a shell

ls  -lasrt /var/spool/asterisk/backup

if you have filestore setup, also that will help

Okay this is the response I got and honestly not to sure what I’m looking at but I do recognize the name that I’m looking for and the date stamp.

0 drwxrwxr-x 2 asterisk asterisk 6 Jan 14 00:33 Monthly-Backup

then look in that directory also

ls  -lasrt /var/spool/asterisk/backup/*

Okay I got 2 results and the one for January is the one I want to use so. Forgive me for sounding dumb but I’m not sure how this fits into the command fwconsole backup --restore [/path/to/restore-xxxxxx.tar.gz] What is the XXXXXX?

is the full path name starting at root ‘/’ and all the way up to ‘…tar.gz’ forget about words like path, to and restore :slight_smile:

Okay so it would be like: fwconsole backup --restore var/spool/asterisk/backup/Monthly-Backup.taz.gz

No, in that directory is an explicit filename, so use that explicit filename and as I said , it needs to be fully ‘rooted’ so include the initial ‘/’

Ah I see. Please see the result below:
[root@palmettoproit ~]# ls -lasrt /var/spool/asterisk/backup/Monthly-Backup
total 0
0 drwxrwxr-x 5 asterisk asterisk 58 Mar 14 2021 …
0 drwxrwxr-x 2 asterisk asterisk 6 Jan 14 00:33 .
[root@palmettoproit ~]# ls -lasrt /var/spool/asterisk/backup/
total 4
0 drwxrwxr-x 3 asterisk asterisk 190 Mar 14 2021 uploads
0 drwxrwxr-x 2 asterisk asterisk 6 Mar 14 2021 3142021
0 drwxrwxr-x 5 asterisk asterisk 58 Mar 14 2021 .
0 drwxrwxr-x 2 asterisk asterisk 6 Jan 14 00:33 Monthly-Backup
4 drwxrwxr-x. 19 asterisk asterisk 4096 Feb 8 01:26 …
[root@palmettoproit ~]# fwconsole backup --restore /var/spool/asterisk/backup/Monthly-Backup
Transaction ID is: 330a3223-1937-485e-b47a-31172e9c2b98
Determining backup file type…type is legacy
Legacy CDR Restore Option: 0
Starting restore job with file: /var/spool/asterisk/backup/Monthly-Backup
Extracting backup…
Parsing out SQL tables. This may take a moment depending on backup size.
Found 0 database files in the backup.
Restore completed successfully

This is also the result of the fwconsole start and stop commands:

[root@palmettoproit ~]# fwconsole stop
Running FreePBX shutdown…

Running Asterisk pre from Core module
Running Asterisk pre from Iotserver module
SmartOffice Server is not running
Running Asterisk pre from Restapps module
RestApps Server is not running
Running Asterisk pre from Sangomaconnect module
SangomaConnect Server is not running
Running Asterisk pre from Ucp module
UCP Node Server is not running
Running Asterisk pre from Xmpp module
Chat Server is not running
Running Asterisk pre from Zulu module
Zulu Server is not running

In php-asmanager.php line 495:

fclose() expects parameter 1 to be resource, boolean given

stop [–pre] [–post] [-i|–immediate] [-m|–maxwait [MAXWAIT]] [–] []

fwconsole start
Asterisk already running
Running FreePBX startup…
Taking too long? Customize the chown command, See FreePBX Chown Conf - FreePBX OpenSource Project - Documentation
Setting Permissions…
Setting base permissions…Done in 2 seconds
Setting specific permissions…
70279 [============================]
Finished setting permissions
Unable to run Pre-Asterisk hooks, because Asterisk is already running on PID 2231 and has been running for 12 minutes, 58 seconds
Running Asterisk post from Adv_recovery module
Advanced Recovery is not licensed.
Running Asterisk post from Core module
Running Asterisk post from Dahdiconfig module
Running Asterisk post from Endpoint module
Asterisk is not connected
Running Asterisk post from Iotserver module
This product is not licensed
Running Asterisk post from Pagingpro module
Running Asterisk post from Restapps module
Starting RestApps Server…
[>---------------------------] < 1 sec
Started RestApps Server. PID is 4664
Running Asterisk post from Sangomaconnect module
This product is not licensed
Running Asterisk post from Ucp module
Starting UCP Node Server…
[>---------------------------] < 1 sec
Started UCP Node Server. PID is 4754
Running Asterisk post from Vqplus module
Queues Pro is not licensed.
Running Asterisk post from Xmpp module
Resetting PBX Users Failed: The command “node /var/www/html/admin/modules/xmpp/node/resetpbxusers.js” failed.

Exit Code: 1(General error)

Working directory: /root

Output:

Error Output:

events.js:183
throw er; // Unhandled ‘error’ event
^

Error: connect ETIMEDOUT
at Connection._handleConnectTimeout (/var/www/html/admin/modules/xmpp/node/node_modules/mysql/lib/Connection.js:409:13)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at Socket.emit (events.js:208:7)
at Socket._onTimeout (net.js:422:8)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
--------------------
at Protocol._enqueue (/var/www/html/admin/modules/xmpp/node/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/var/www/html/admin/modules/xmpp/node/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/var/www/html/admin/modules/xmpp/node/node_modules/mysql/lib/Connection.js:116:18)
at Connection._implyConnect (/var/www/html/admin/modules/xmpp/node/node_modules/mysql/lib/Connection.js:454:10)
at Connection.query (/var/www/html/admin/modules/xmpp/node/node_modules/mysql/lib/Connection.js:196:8)
at /var/www/html/admin/modules/xmpp/node/node_modules/freepbx/lib/config.js:24:26
at Promise._execute (/var/www/html/admin/modules/xmpp/node/node_modules/bluebird/js/release/debuggability.js:384:9)
at Promise._resolveFromExecutor (/var/www/html/admin/modules/xmpp/node/node_modules/bluebird/js/release/promise.js:518:18)
at new Promise (/var/www/html/admin/modules/xmpp/node/node_modules/bluebird/js/release/promise.js:103:10)
at Config.load (/var/www/html/admin/modules/xmpp/node/node_modules/freepbx/lib/config.js:23:11)
at /var/www/html/admin/modules/xmpp/node/node_modules/freepbx/lib/freepbx.js:118:10
at Promise._execute (/var/www/html/admin/modules/xmpp/node/node_modules/bluebird/js/release/debuggability.js:384:9)
at Promise._resolveFromExecutor (/var/www/html/admin/modules/xmpp/node/node_modules/bluebird/js/release/promise.js:518:18)
at new Promise (/var/www/html/admin/modules/xmpp/node/node_modules/bluebird/js/release/promise.js:103:10)
at LoadFreePBXConfig (/var/www/html/admin/modules/xmpp/node/node_modules/freepbx/lib/freepbx.js:115:9)
at tryCatcher (/var/www/html/admin/modules/xmpp/node/node_modules/bluebird/js/release/util.js:16:23)

Running Asterisk post from Zulu module
This product is not licensed

I can’t help you with unlicensed products after an apparent successful restore, but you probably need to delete any failing modules with ‘fwconsole ma delete . . .’ and then ‘fwconsole reload’

Its been failing at activating since the guy messed it up and the restore didn’t appear to restore anything at all.

You posted

Restore completed successfully

Indicating that FreePBX per se was resored, activating previously purchased commercial modules might take more effort

But it said it restored 0 files.
Extracting backup…
Parsing out SQL tables. This may take a moment depending on backup size.
Found 0 database files in the backup.
Restore completed successfully

Then unfortunately your backup did not include what you wanted.