Automatic scheduled backup of InControl server databaseLast modified on 5 Feb, 2021. Revision 18
|Up to date for||
Is there any way to automate the InControl server database backup procedure?
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 of the database directory to a destination of your choosing, then restart the service. We’ll need to define where the path for the 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 %AppData%\Clavister\InControl\Server folder, unless another path is selected.
The BackupPath is the directory where the script should copy the DB too. The backups will be stored in subdirectorys with a date stamp.
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.
Create a new task, this is done in the task scheduler
Make sure that “Run whether user is logged on or not” is selected and that “Do not store password” is unchecked.
Note: Depending on account privileges setting “Run with highest privileges” might have to be checked depending if the account have the right to change “executionpolicy” in Powershell.
Create a trigger, this is set to how often the script should backup the DB. The settings here decides how often the script should be run to take a backup.
Create an action, here we set the action that the task will run.
As “Program/Script” choose the Powershell.exe file located in
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.
Here you can Download the script:
Note: The script will copy the server directory. So if any manual backups have been saved there they will also get copied with the backup script. Also if any file or folder have been moved from the server directory they will not be copied with the backup script
No related articles found.