Page tree
Skip to end of metadata
Go to start of metadata

Introduction

The following commands will work in FreePBX 15+

This page is for the new commands in FreePBX 15+, please see fwconsole commands (13+) for the existing fwconsole commands from FreePBX 13

Backup

List Backups

# fwconsole backup --list
fwconsole backup --backup=[Backup ID]
+-------------+-------------+--------------------------------------+
| Backup Name | Description | Backup ID                            |
+-------------+-------------+--------------------------------------+
| Test Backup | YOLO        | 2dad0248-ca89-43a3-b761-82848399d903 |
+-------------+-------------+--------------------------------------+

Run Backup

# fwconsole backup --backup=2dad0248-ca89-43a3-b761-82848399d903
Starting backup job with ID: d560ee22-1765-4b87-96a7-ef6fbc0e9c7c
2017-09-20T08:34:07-07:00 [d560ee22-1765-4b87-96a7-ef6fbc0e9c7c] - Running pre backup hooks
2017-09-20T08:34:07-07:00 [d560ee22-1765-4b87-96a7-ef6fbc0e9c7c] - Starting backup Test_Backup
2017-09-20T08:34:07-07:00 [d560ee22-1765-4b87-96a7-ef6fbc0e9c7c] - This backup will be stored locally at /var/spool/asterisk/backup/Test_Backup/backup-1505921647.tar and is subject to maintinance settings
2017-09-20T08:34:12-07:00 [d560ee22-1765-4b87-96a7-ef6fbc0e9c7c] - Saving to selected Filestore locations
2017-09-20T08:34:14-07:00 [d560ee22-1765-4b87-96a7-ef6fbc0e9c7c] - Cleaning up
2017-09-20T08:34:16-07:00 [d560ee22-1765-4b87-96a7-ef6fbc0e9c7c] - Running post backup hooks
2017-09-20T08:34:16-07:00 [d560ee22-1765-4b87-96a7-ef6fbc0e9c7c] - Backup completed successfully

Dump Backup job for remote

fwconsole backup --dumpextern=2dad0248-ca89-43a3-b761-82848399d903

Run backup with remote string and custom transaction id

backup --externbackup='BASE64STRING' --transaction='transactionstring'
#will output transactionstring.tar.gz

Restore Legacy CDR using command line 

fwconsole backup --restore /home/20200109-110433-1578548073-14.0.13.23-818337824.tgz --restorelegacycdr
Transaction ID is: 76bbbff3-c47f-4b5f-b5ca-e922e230cba9
Determining backup file type...type is legacy
Legacy CDR Restore Option: 1
Starting restore job with file: /home/20200109-110433-1578548073-14.0.13.23-818337824.tgz
Extracting backup...

Restore Legacy Backup using in-file-db(sqlite) instead of in-memory via command line (--useinfiledb)

This recommended only for Legacy Heavy backup which can cause memory issue shown below And this option (--useinfiledb) will make the restore process very  slow

proc_open(): fork failed - Cannot allocate memory on line 523 of file /var/www/html/admin/libraries/BMO/GPG.class.php
#0 [internal function]: Whoops\Run->handleError(2, 'proc_open(): fo...', '/var/www/html/a...', 523, Array)
#1 /var/www/html/admin/libraries/BMO/GPG.class.php(523): proc_open('/usr/bin/gpg2 -...', Array, NULL, '/tmp', Array)


 This kind restore is possible only via command line , And the option you need to pass is --useinfiledb

fwconsole backup --restore /home/20200109-110433-1578548073-14.0.13.23-818337824.tgz --useinfiledb
Transaction ID is: 76bbbff3-c47f-4b5f-b5ca-e922e230cba9
Determining backup file type...type is legacy
Starting restore job with file: /home/20200109-110433-1578548073-14.0.13.23-818337824.tgz
Extracting backup...
Legacy Restore is using file based sqlite
Loading manifest to memory
Loading astdb to memory
Utilizing file based sqlite at /tmp/76bbbff3-c47f-4b5f-b5ca-e922e230cba9.db, This is SLOW

Core

Convert Legacy chan_sip extensions to chan_pjsip

To convert all chan_sip extensions to chan_pjsip

fwconsole convert2pjsip -all
fwconsole reload


To convert specific chan_sip extensions to chan_pjsip you can specify each one separated by a comma. (Example: 6020, 6030, 6040)

fwconsole convert2pjsip -r 6020,6030,6040
fwconsole reload


You can also specify a range of extensions (Example: 5000 through 5100 and 6020 through 6040)

fwconsole convert2pjsip -r 5000-5100,6020-6040
fwconsole reload

Note: Use `fwconsole reload` to reload the config in FreePBX

Module Admin

Skip "breaking" checks when installing modules that is deprecated or has conflicts

This will skip checks for all modules

fwconsole ma install foomodule --skipbreakingcheck

For a specific module

fwconsole ma install foomodule barmodule --skipbreakingcheck=foomodule

For multiple specified modules

fwconsole ma install foomodule barmodule bazmodule --skipbreakingcheck=foomodule,barmodule

Installing specific module versions with multiple modules

fwconsole ma install foomodule:15.1.3 barmodule:15.0.9
  • No labels