Automatic scheduled backup of InControl server database

InControl Frequently Asked Questions
Post Reply
mape
Posts: 41
Joined: 24 Oct 2016, 08:23

Automatic scheduled backup of InControl server database

Post by mape » 24 Nov 2016, 13:37

This FAQ applies to:
  • Clavister InControl version 1.x
Question:
Is there any way to automate the ICS DB backup procedure ?

Answer:
We have created a script for just this purpose, this script can be combined with Windows task scheduler.

How the script works:
The script will look for a running ICS service, stop it, then make a copy to a destination of our choosing, then restart the service. We'll need to define where the path for the ics.db3 database is, and a path to back it up to, then make a new task scheduler entry that invokes the script with unrestricted Powershell script execution. Once that's done it should run however often we like as defined by the task scheduler job. So, the part of the script we need to modify looks like this:

$DatabasePath = "C:\ICDATABASE"
$BackupPath = "C:\ICBACKUP"

Point DatabasePath to where the InControl database (ics.db3) is located. The original path to the (ics.db3) is inside the C:\Users\User\AppData\Roaming\Clavister\InControl\Server folder, unless you selected another path.
The BackupPath you can select wherever you like the backups to be store.

Windows Task Scheduler:
It would be a good idea to make a new user with admin privileges for handling the backup job. For that user, open up Task Scheduler and follow the guide below.

Step1:
Create a new task, this is done in the task scheduler
New Task.png
New Task.png (62.6 KiB) Viewed 2888 times
Step2:
Make sure that "Run whether user is logged on or not" is selected and that "Do not store password" is unchecked.
User.png
User.png (66.47 KiB) Viewed 2884 times
Step3:
Create a trigger, this is set to how often you want the script to trigger.
New Trigger.png
New Trigger.png (79.97 KiB) Viewed 2888 times
Step4:
Create an action, here we set the action that the task will run.
As "Program/Script" choose the Powershell.exe file located in C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.
Then as argument add: -ExecutionPolicy Unrestricted -File "C:\Users\User\Desktop\backup-ics.ps1" .
NOTE:This path: C:\Users\User\Desktop\backup-ics.ps1 is were you have this script located.
Action.png
Action.png (72 KiB) Viewed 2888 times
Download:
Here you can Download the script:
backup-ics.zip
(428 Bytes) Downloaded 372 times

Post Reply