Overview
In the past backing up and restoring a telephony configuration meant overwriting any existing telephony configuration.While this is expected behaviour for a backup and restore it didn't offer any convenience for administrators wanting to consolidate multiple tenants from separate systems into a single ScopTEL installation.
The new Telephony Import/Export Manager allows administrators to log in to an upgraded ScopTEL system and Export any existing tenant into a file.
All Telephony configuration is Exported including Auto Attendants, Applications, Extensions, Lines, Schedules, APS objects... etc
VoIP Interfaces configured within the Global (All) Tenant are not Exported as these belong to the Global (All) Tenant. Therefore after the Import is completed the Mass Operations Tool in the Lines Manager can be used to reassign VoIP Interfaces to the Incoming/Outgoing Lines created by the Import.
The Export file can then be Imported to any upgraded ScopTEL server and this will automatically create a new Tenant in Telephony without overwriting any existing Telephony configuration.
On Import you first choose the Export file location using the Upload file button and select a valid Exported file from your workstation. Then click on Import.
Once you confirm the Import the system will automatically create a new tenant (ex. original name = test123, new tenant = new_123 )
However, if a Tenant with the name new_123 already exists, the Import will delete the existing Tenant and import new data, so it necessary to validate existing Tenant names to avoid an existing Tenant from being overwritten.
Once you verify the Import you can Edit the new Tenant in the ScopTEL Tenant Manager and rename it BEFORE Importing any additional Tenant files.
Caveats
The Import does NOT backup CDR reports, sound files, voicemail, monitor files, MOH files.
These files must be manually copied to the destination system.
The server license on the Import server must support the additional Tenants these Imports will create.
Supported Import/Export Paths
- EL2-6 are End Of Life
- But Scopserv has added manual patch locations for C6 based systems so they can be easily migrated to an officially support Operating System.
- For EL7 systems we will maintain repositories for as long as possible but the Operating System End Of Life date must be respected and best practices observed
- scopserv_yum update or Packages Manager updates will install the new feature
- For Rocky 8 scopserv_yum update or Packages Manager updates will install the new feature if it's not already installed
wget --no-check-certificate -O /var/www/scopserv/telephony/config/params/import/export.php https://scm.scopserv.com/files/c/7/9/c7939f88e707640835f6b0dc07b8d766.phps
wget --no-check-certificate -O /var/www/scopserv/telephony/config/params/import/import.php https://scm.scopserv.com/files/1/e/d/1edeeae0fe8957fa894cd3c9da287653.phps
wget --no-check-certificate -O /var/www/scopserv/telephony/tools/import.php https://scm.scopserv.com/files/9/8/8/988dcd1b836f94a9ea4f8e4105a94068.phps
wget --no-check-certificate -O /var/www/scopserv/telephony/lib/Driver/sql.php https://scm.scopserv.com/files/a/d/2/ad297b28cd89281ef927dc87c4077aaa.phps
Tenant Export
After patching, login with an account that has access to the Tools|Import/Export Manager
Click on the Export tab then use the drop list selector to choose the Tenant for Export.
Click on the Export button to Export the selected Tenant and save the file to your workstation.
The file name can be any value when saved so long as the .jason extension is kept. Unique information for the tenant is baked into the file.
Tenant Import
Click on the Import tab, and to begin the Import click 'Choose file' and select the location from where it is saved in your workstation.
The Source file will now display tenant attributes.
Click on the Import button to complete the Tenant Import.
Tenant Manager
Rename the tenant as required with the Edit button and Save your changes.
Repeat the process any many times as the license permits.
Lines Mass Operations
The resulting Import will most likely be based on VoIP Interfaces previously belonging to the Global (All) Tenant so these interfaces won't be part of the original Export so each Error! would be expected.
Therefore the Incoming Lines and Outgoing Lines will need to have existing trunks on the Import server prior to assigning Trunks to the Incoming and Outgoing Lines using the Mass Operations tools.
If trunks exist to support these Imported Lines then use the Mass Operations tool to assign trunks and complete the Tenant Import.
Shell Scripts to Export and Import ACD Reports
CAVEAT: These scripts only export reporting data and NOT recording files. Call recordings must be copied from /var/spool/asterisk/monitor/ and uploaded to any server or drive replacement!
For C6 systems download the scripts first (For C7 and R8 scripts will be added by standard package updates):
cd /var/www/scopserv/telephony/scripts/
chown -R scopserv_report_dump.sh
chown -R scopserv_report_restore.sh
chmod a+x scopserv_report_dump.sh
chmod a+x scopserv_report_restore.sh
Usage:
scopserv_report_dump.sh [OPTIONS]
Options:
--tenant=TENANT Set the tenant name (default: 'default')
--database=DATABASE Set the database name (default: 'scopserv')
--cdr Dump CDR table
--acd Dump ACD (queue_log) table
--cel Dump CEL table
--all Dump all tables (CDR, ACD, CEL)
--from=YYYY-MM-DD Set start date for data filtering
--to=YYYY-MM-DD Set end date for data filtering
--help Display this help and exit
Examples:
Dump all tables for the default tenant:
./scopserv_report_dump.sh --all
Dump only the CDR table for tenant 'default':
./scopserv_report_dump.sh --tenant=default --cdr
Dump CDR, ACD, and CEL tables for tenant 'default' on database 'scopserv_repl':
./scopserv_report_dump.sh --database=scopserv_repl --tenant=default --acd --cel --cdr
Dump CDR, ACD, and CEL tables for tenant 'default' from 2021-01-01 to 2021-01-31:
./scopserv_report_dump.sh --tenant=default --acd --cel --cdr --from=2021-01-01 --to=2021-01-31
Dump ACD table for tenant 'example' from 2022-05-01:
./scopserv_report_dump.sh --tenant=example --acd --from=2022-05-01
RESTORE
./scopserv_report_restore.sh
Options:
--database=DATABASE Specify the database name (default: 'scopserv')
--filename=FILENAME Specify the filename for restore
--tenant=TENANT Specify the new tenant name (optional, defaults to original tenant)
--help Display this help and exit
Examples:
Restore from a specific dump file for the same tenant:
./scopserv_report_restore.sh --filename=default_cdr.sql
Restore from a specific dump file cdr data new tenant:
./scopserv_report_restore.sh --filename=default_cdr.sql --tenant=newtenant
Restore from a specific dump file acd data for a new tenant:
./scopserv_report_restore.sh --filename=default_queue_log.sql --tenant=newtenant
Restore from a specific dump file with a specified database:
./scopserv_report_restore.sh --filename=default_cdr.sql --database=another_db