This post will show the proper way to backup a HQ Shoretel server. The first method is a tried and true batch script method. The second method here will address the correct backup method using Veeam Backup and Replication 6.1 U1 where your Shoretel servers are running in a VMware environment. Veeam backup is a cut above the rest and I strongly urge it's use any time backups are required in a virtual environment. ***10/3/2012 edit*** I have modified the script a bit in this blog and simplified the blog from the last edit. In the old script I was stopping the database service twice to be sure the DB service was off, this does not seem to work in an environment where there is a DVS server. Since the startup type is still set to automatic, when the DVS attempts to sync with the HQ, it will start some services back up. The script reflects a better way to disable, and stop the services so you are sure to get a clean copy of "C:\shoreline data". Also, I have removed the part in the script from the last edit where we were stopping the ST COM+ service. This is not necessary and causes more problems than it's worth.
Method 1: The batch script.
Shoretel uses MySQL to run it's back end database for configuration data and call records. This is light years beyond the Access type database they used in the (very) early day's. There is one issue though, MySQL does not have a VSS Writer. (Volume Snapshot Service or Volume Shadow Copy Service or VSS) Log on to your Shoretel server and pull up a command prompt. Type "vssadmin list writers".

No MySQL VSS! This causes a problem when trying to backup the Shoretel data. Without a snapshot, you can't copy the data while the database is running because it has files locked. Tying to backup/copy Shoretel data while the database/Shoretel services are running will result in corrupt data in the backup, and possibly even corrupt live data. To completely restore your Shoretel server from a disaster on a new server, all you need is a copy of the install software for the build you were running when you took the backup, and a good copy of the "C:\shoreline data". Here is the batch script I use to backup my Shoretel servers:
----------code----------
@ECHO OFF
REM **********************************************************************
REM ***** Curt Corwin - Accent Information
REM ***** This script will run every Monday at 3:15am - Stay away form 2:00am
REM ***** This script was written for Shoretel 12.3 build 17.62.1400.0
REM **********************************************************************
echo Starting Backup Job %date% - %time% >> c:\Accent-Scripts\ShoreTel-Backup-LOG.txt
echo Set Registry Start Type to Disable
sc config "ShoreTel-VmEmSync" start= demand
sc config "ShoreTel-CSISVMSVC" start= demand
sc config "ShoreTel-MYSQLCDR" start= demand
sc config "ShoreTel-TMS" start= demand
sc config "ShoreTel-MailServ" start= demand
sc config "ShoreTel-EventWatch" start= demand
sc config "ShoreTel-DirectorUtil" start= demand
sc config "ShoreTel-MYSQLConfig" start= demand
sc config "ShoreTel-WebFrameworkSvc" start= demand
sc config "ShoreTel-CDR" start= demand
sc config "ShoreTel-IPDS" start= demand
sc config "ShoreTel-CSISSVC" start= demand
sc config "ShoreTel-Zin" start= demand
sc config "ShoreTel-DBUpdateSvc" start= demand
sc config "ShoreTel-DRS" start= demand
sc config "ShoreTel-DTASSvc" start= demand
sc config "ShoreTel-EventSvc" start= demand
sc config "ShoreTel-IPCS" start= demand
sc config "ShoreTel-Notify" start= demand
sc config "ShoreTel-SoftSwitch" start= demand
sc config "ShoreTel-Portmap" start= demand
sc config "ShoreTel-RemoteLogSvc" start= demand
sc config "ShoreTel-TransportSvc" start= demand
sc config "ShoreTel-PortMgr" start= demand
sc config "ShoreTel-WGSvc" start= demand
echo Stopping ALL Shoretel services
net stop ShoreTel-VmEmSync
net stop ShoreTel-CSISVMSVC
net stop ShoreTel-MYSQLCDR
net stop ShoreTel-TMS
net stop ShoreTel-MailServ
net stop ShoreTel-EventWatch
net stop ShoreTel-DirectorUtil
net stop ShoreTel-MYSQLConfig
net stop ShoreTel-WebFrameworkSvc
net stop ShoreTel-CDR
net stop ShoreTel-IPDS
net stop ShoreTel-CSISSVC
net stop ShoreTel-Zin
net stop ShoreTel-DBUpdateSvc
net stop ShoreTel-DRS
net stop ShoreTel-DTASSvc
net stop ShoreTel-EventSvc
net stop ShoreTel-IPCS
net stop ShoreTel-Notify
net stop ShoreTel-SoftSwitch
net stop ShoreTel-Portmap
net stop ShoreTel-RemoteLogSvc
net stop ShoreTel-TransportSvc
net stop ShoreTel-PortMgr
net stop ShoreTel-WGSvc
echo Waiting 10 seconds
TIMEOUT /T 10
echo Remove last backup
RMDIR /S /Q "C:\Accent-Backups\Shoreline Data"
echo Wait for 10 seconds
TIMEOUT /T 10
echo Copy the goods to c:\Accent-Backups
xcopy "C:\Shoreline Data" "C:\Accent-Backups\Shoreline Data" /I /E /H /Y
echo Wait for 10 seconds
TIMEOUT /T 10
echo setting services to auto mode
sc config "ShoreTel-WGSvc" start= auto
sc config "ShoreTel-PortMgr" start= auto
sc config "ShoreTel-TransportSvc" start= auto
sc config "ShoreTel-RemoteLogSvc" start= auto
sc config "ShoreTel-Portmap" start= auto
sc config "ShoreTel-SoftSwitch" start= auto
sc config "ShoreTel-Notify" start= auto
sc config "ShoreTel-IPCS" start= auto
sc config "ShoreTel-EventSvc" start= auto
sc config "ShoreTel-DTASSvc" start= auto
sc config "ShoreTel-DRS" start= auto
sc config "ShoreTel-DBUpdateSvc" start= auto
sc config "ShoreTel-Zin" start= auto
sc config "ShoreTel-CSISSVC" start= auto
sc config "ShoreTel-IPDS" start= auto
sc config "ShoreTel-CDR" start= auto
sc config "ShoreTel-WebFrameworkSvc" start= auto
sc config "ShoreTel-MYSQLConfig" start= auto
sc config "ShoreTel-DirectorUtil" start= auto
sc config "ShoreTel-EventWatch" start= auto
sc config "ShoreTel-MailServ" start= auto
sc config "ShoreTel-TMS" start= auto
sc config "ShoreTel-MYSQLCDR" start= auto
sc config "ShoreTel-CSISVMSVC" start= auto
sc config "ShoreTel-VmEmSync" start= auto
echo Start all Shoretel services back up again
net start ShoreTel-WGSvc
net start ShoreTel-PortMgr
net start ShoreTel-TransportSvc
net start ShoreTel-RemoteLogSvc
net start ShoreTel-Portmap
net start ShoreTel-SoftSwitch
net start ShoreTel-Notify
net start ShoreTel-IPCS
net start ShoreTel-EventSvc
net start ShoreTel-DTASSvc
net start ShoreTel-DRS
net start ShoreTel-DBUpdateSvc
net start ShoreTel-Zin
net start ShoreTel-CSISSVC
net start ShoreTel-IPDS
net start ShoreTel-CDR
net start ShoreTel-WebFrameworkSvc
net start ShoreTel-MYSQLConfig
net start ShoreTel-DirectorUtil
net start ShoreTel-EventWatch
net start ShoreTel-MailServ
net start ShoreTel-TMS
net start ShoreTel-MYSQLCDR
net start ShoreTel-CSISVMSVC
net start ShoreTel-VmEmSync
echo.
echo Job Done %date% - %time% >> c:\Accent-Scripts\ShoreTel-Backup-LOG.txt
echo. >> c:\Accent-Scripts\ShoreTel-Backup-LOG.txt
echo. >> c:\Accent-Scripts\ShoreTel-Backup-LOG.txt
----------code----------
This has been tested on Shoretel version 12.3. Other versions may need to stop/start services in a different order.
The script above will shutdown all Shoretel services, remove last backup, xcopy all "c:\shoreline data" to the backup folder, then start all services back up. It is meant to be run by the windows scheduler but can be run manually. It will create a log file recording start, and stop time. The log file can be deleted at any time. It is small, but will grow in time.
1. Create a directory under c:\ called "Accent-Backups".
2. Create a directory under c:\ called "Accent-Scripts".
3. Copy the script into "C:\Accent-Scripts" and name it so the file ends in .bat.
4. Run this manually or schedule an event to run it when ever you need. Stay away from 2:00am as database maintenance happens at that time. 3:15am is a good time. Log file will be in "C:\Accent-Scripts". The data in "C:\Accent-Backups" can then be copied or backed up at will. I usually keep a copy of the shoreline data and the current build I'm on together in a safe place.
Quick, easy, effective.
Method 2: The Pre-Freeze and Post-Thaw batch script with Veeam and VMware.
All Windows servers (especially MSSQL and exchange) being backed up with Veeam should use the VSS backup option "Enable application-aware image processing". All, except for Shoretel servers. See below a screenshot of where to configure this in your Veean backup job:
However, this option should NOT be used to back up Shoretel servers because there is no VSS writer for MySQL. What you'll end up with (at best) is crash consistent backup if you use this option with MySQL. Windows will be restored correctly but because the MySQL files are locked open during backup time, and there is no way to snapshot the MySQL database and it's log files, you will not get a good backup.
So, how can we backup Shoretel servers with Veeam? When creating a backup job for the Shoretel server, you need to use an option called "Enable VMWare Tools Quiescence". Seen in the screen shot below:
The use of this option will call a script on the Shoretel server located in the VMWare Tools directory. All scripts in this directory will be run in alphabetical order. This script will shut down all Shoretel services before taking the snapshot for the backup, giving you a good backup of the data. The scripts are called Freeze and Post-Thaw scripts.
Here is the script:
----------code----------
@ECHO OFF
REM ************************************************************************
REM ***** Curt Corwin - Accent Information
REM ***** This script will work with VMWare to freeze and thaw Shoretel during backups
REM ***** To be used with Veeam and the "Enable VMWare tools quiescence"option
REM ************************************************************************
if "%1" == "freeze" goto dofreeze
if "%1" == "freezeFail" goto dofreezeFail
if "%1" == "thaw" goto doThaw
goto EOF
:dofreeze
sc config "ShoreTel-VmEmSync" start= demand
sc config "ShoreTel-CSISVMSVC" start= demand
sc config "ShoreTel-MYSQLCDR" start= demand
sc config "ShoreTel-TMS" start= demand
sc config "ShoreTel-MailServ" start= demand
sc config "ShoreTel-EventWatch" start= demand
sc config "ShoreTel-DirectorUtil" start= demand
sc config "ShoreTel-MYSQLConfig" start= demand
sc config "ShoreTel-WebFrameworkSvc" start= demand
sc config "ShoreTel-CDR" start= demand
sc config "ShoreTel-IPDS" start= demand
sc config "ShoreTel-CSISSVC" start= demand
sc config "ShoreTel-Zin" start= demand
sc config "ShoreTel-DBUpdateSvc" start= demand
sc config "ShoreTel-DRS" start= demand
sc config "ShoreTel-DTASSvc" start= demand
sc config "ShoreTel-EventSvc" start= demand
sc config "ShoreTel-IPCS" start= demand
sc config "ShoreTel-Notify" start= demand
sc config "ShoreTel-SoftSwitch" start= demand
sc config "ShoreTel-Portmap" start= demand
sc config "ShoreTel-RemoteLogSvc" start= demand
sc config "ShoreTel-TransportSvc" start= demand
sc config "ShoreTel-PortMgr" start= demand
sc config "ShoreTel-WGSvc" start= demand
net stop ShoreTel-VmEmSync
net stop ShoreTel-CSISVMSVC
net stop ShoreTel-MYSQLCDR
net stop ShoreTel-TMS
net stop ShoreTel-MailServ
net stop ShoreTel-EventWatch
net stop ShoreTel-DirectorUtil
net stop ShoreTel-MYSQLConfig
net stop ShoreTel-WebFrameworkSvc
net stop ShoreTel-CDR
net stop ShoreTel-IPDS
net stop ShoreTel-CSISSVC
net stop ShoreTel-Zin
net stop ShoreTel-DBUpdateSvc
net stop ShoreTel-DRS
net stop ShoreTel-DTASSvc
net stop ShoreTel-EventSvc
net stop ShoreTel-IPCS
net stop ShoreTel-Notify
net stop ShoreTel-SoftSwitch
net stop ShoreTel-Portmap
net stop ShoreTel-RemoteLogSvc
net stop ShoreTel-TransportSvc
net stop ShoreTel-PortMgr
net stop ShoreTel-WGSvc
goto EOF
:dofreezeFail
sc config "ShoreTel-WGSvc" start= auto
sc config "ShoreTel-PortMgr" start= auto
sc config "ShoreTel-TransportSvc" start= auto
sc config "ShoreTel-RemoteLogSvc" start= auto
sc config "ShoreTel-Portmap" start= auto
sc config "ShoreTel-SoftSwitch" start= auto
sc config "ShoreTel-Notify" start= auto
sc config "ShoreTel-IPCS" start= auto
sc config "ShoreTel-EventSvc" start= auto
sc config "ShoreTel-DTASSvc" start= auto
sc config "ShoreTel-DRS" start= auto
sc config "ShoreTel-DBUpdateSvc" start= auto
sc config "ShoreTel-Zin" start= auto
sc config "ShoreTel-CSISSVC" start= auto
sc config "ShoreTel-IPDS" start= auto
sc config "ShoreTel-CDR" start= auto
sc config "ShoreTel-WebFrameworkSvc" start= auto
sc config "ShoreTel-MYSQLConfig" start= auto
sc config "ShoreTel-DirectorUtil" start= auto
sc config "ShoreTel-EventWatch" start= auto
sc config "ShoreTel-MailServ" start= auto
sc config "ShoreTel-TMS" start= auto
sc config "ShoreTel-MYSQLCDR" start= auto
sc config "ShoreTel-CSISVMSVC" start= auto
sc config "ShoreTel-VmEmSync" start= auto
net start ShoreTel-WGSvc
net start ShoreTel-PortMgr
net start ShoreTel-TransportSvc
net start ShoreTel-RemoteLogSvc
net start ShoreTel-Portmap
net start ShoreTel-SoftSwitch
net start ShoreTel-Notify
net start ShoreTel-IPCS
net start ShoreTel-EventSvc
net start ShoreTel-DTASSvc
net start ShoreTel-DRS
net start ShoreTel-DBUpdateSvc
net start ShoreTel-Zin
net start ShoreTel-CSISSVC
net start ShoreTel-IPDS
net start ShoreTel-CDR
net start ShoreTel-WebFrameworkSvc
net start ShoreTel-MYSQLConfig
net start ShoreTel-DirectorUtil
net start ShoreTel-EventWatch
net start ShoreTel-MailServ
net start ShoreTel-TMS
net start ShoreTel-MYSQLCDR
net start ShoreTel-CSISVMSVC
net start ShoreTel-VmEmSync
goto EOF
:doThaw
sc config "ShoreTel-WGSvc" start= auto
sc config "ShoreTel-PortMgr" start= auto
sc config "ShoreTel-TransportSvc" start= auto
sc config "ShoreTel-RemoteLogSvc" start= auto
sc config "ShoreTel-Portmap" start= auto
sc config "ShoreTel-SoftSwitch" start= auto
sc config "ShoreTel-Notify" start= auto
sc config "ShoreTel-IPCS" start= auto
sc config "ShoreTel-EventSvc" start= auto
sc config "ShoreTel-DTASSvc" start= auto
sc config "ShoreTel-DRS" start= auto
sc config "ShoreTel-DBUpdateSvc" start= auto
sc config "ShoreTel-Zin" start= auto
sc config "ShoreTel-CSISSVC" start= auto
sc config "ShoreTel-IPDS" start= auto
sc config "ShoreTel-CDR" start= auto
sc config "ShoreTel-WebFrameworkSvc" start= auto
sc config "ShoreTel-MYSQLConfig" start= auto
sc config "ShoreTel-DirectorUtil" start= auto
sc config "ShoreTel-EventWatch" start= auto
sc config "ShoreTel-MailServ" start= auto
sc config "ShoreTel-TMS" start= auto
sc config "ShoreTel-MYSQLCDR" start= auto
sc config "ShoreTel-CSISVMSVC" start= auto
sc config "ShoreTel-VmEmSync" start= auto
net start ShoreTel-WGSvc
net start ShoreTel-PortMgr
net start ShoreTel-TransportSvc
net start ShoreTel-RemoteLogSvc
net start ShoreTel-Portmap
net start ShoreTel-SoftSwitch
net start ShoreTel-Notify
net start ShoreTel-IPCS
net start ShoreTel-EventSvc
net start ShoreTel-DTASSvc
net start ShoreTel-DRS
net start ShoreTel-DBUpdateSvc
net start ShoreTel-Zin
net start ShoreTel-CSISSVC
net start ShoreTel-IPDS
net start ShoreTel-CDR
net start ShoreTel-WebFrameworkSvc
net start ShoreTel-MYSQLConfig
net start ShoreTel-DirectorUtil
net start ShoreTel-EventWatch
net start ShoreTel-MailServ
net start ShoreTel-TMS
net start ShoreTel-MYSQLCDR
net start ShoreTel-CSISVMSVC
net start ShoreTel-VmEmSync
goto EOF
:EOF
----------code----------
1. Navigate on the Shoretel server to "C:\program files\VMWare\VMware Tools" and create a directory called "backupScripts.d" and place the script there. Rename it to A-Backup-Shoretel.bat.
2. Inside of Veeam, create another job dedicated to backup Shoretel. Check the checkbox "Enable VMWare Tools Quiescence" and do not enable Application-Aware VSS backups. This should run all of the scripts inside of "C:\program files\VMWare\VMware Tools\backupScripts.d", giving you a good backup. It will shutdown all Shoretel services, take the snapshot, start Shoretel services back up again, and complete the backup using the snapshot with MySQL/Shoretel services off.
See below for a video of this happening: