Setting up a Scheduled backup for SQL Express Follow


For LX On-Premise customers that run SQL Server 2008 Express or newer, a scheduled backup script needs to be deployed to back up the LX database. This is required as current version of GlasPacLX are unable to perform an automated backup of the LX database and SQL Server Express does not provide the facilities to run SQL jobs.

Before a scheduled task can be created, a batch file needs to be created on the machine running the SQL Server Express instance using the template attached to this article.

Modifying the SQL Script

You will need to edit a few variables in the file to match the way the customer’s server is set up. Those variables are: SERVERNAME, DATABASENAME and BACKUPPATH. The SERVERNAME needs to include both a server name (“localhost” works in most cases) and the name of the SQL Server instance. If the LX database is running on the default SQL Server instance, both the backslash and instance name will need to be omitted.

The BACKUPPATH value needs to be set to the location where the backups will reside and should be a directory dedicated for LX database backups. The reason why this is necessary is that the script includes a cleanup routine and it will remove any and all files that have an extension of BAK.

By default, the script will clean up backup files that are over 7 days old, represented by “/D -7” in the “forfiles” command at the end of the script. If the customer wants to keep the backups for a different period of time, change that value accordingly.

Save the script out to a location on the main system drive (verify that Notepad doesn’t append “.txt” to the script’s name) and create the directory, if it doesn’t already exist, where the database backup files will be written out to.

Windows Task Scheduler

Next, launch the Task Scheduler program under the Control Panel > Administrative Tools if the machine is running Windows Vista/Windows Server 2008 or newer, then browse to the “Task Scheduler Library” node. For Windows XP and Windows Server 2003 machines, Task Scheduler is located within the main Control Panel window.

For Windows Vista/Windows Server 2008 and newer machines, click on the “Create Basic Task…” item within the Actions pane to start the wizard.


Enter in a name for the new task and click Next.

Choose how often the task should be started and when.

Set the new task to start a program and point it to the batch file that is created.

At the last step of the wizard, make sure to check “Open the Properties dialog for this task when I click Finish” checkbox before clicking “Finish”.

Once task has been created and the Properties dialog opens up, change the Security Options so that the task is set to “Run whether the user is logged on or not”. You should also make sure that the user listed is a local Administrator of the system. If not, you can either make that user a local Administrator or create a specific backup user that is a local Administrator. When you click OK to save the settings and close the window, it should prompt for the user’s password.

Have more questions? Submit a request


Powered by Zendesk