Question
How to backup Work-IT database manually, or schedule daily backup automatically ?
Answer
(a) Create Work-IT database backup manually
1- Open Microsoft SQLServer Management Studio, and login with "SQL Server Authentication" and "sa" credentials.
2- Open the folder “Databases” and select the database you want to backup.
Right mouse click and select “Tasks” and then “Back Up”
3- Then you will get this window:
Make sure the following choices are selected, in page "General"
- Database
- Backup to "Disk"
4- Add or Remove backup directories, and write the name of backup file with the extension ".Bak"
Note: make sure you back up the Work-IT database on the local disk, and let the system administrator secure the back-up
5- Now click on “OK” to execute the back-up
(b) Schedule Work-IT database backup automatically
First
1. Copy the backup setup files in c:\work-it\backup (or any other location from which the copying should be started).
(see the attached *.7z file, so don't forget to unzip the file first)
2. Fill in the *.bat file.
3. The server name of the SQL server
4. The database name
5. The location where the 1st backup should be.
6. Location where the *.bat and *.sql file are placed
7. Possible location for the 2nd file. (It's not basically necessary, so this line can be deleted)
8. Add "pause" at the bottom if necessary, so you can see what happened after the execution. Don't forget to remove it after checking, otherwise, the backup will only be executed once.
9. Start the *.bat file and see if the backup files are created in both locations
For example:
And when the backup *.bat file worked properly, you can then add it to Task scheduler in Windows, to run daily at certain time.
Second
1. Open Windows Task Scheduler (via the control panel, system administration, task scheduler)
2. From the right side menu "Actions" click Create task...
3. On the "General" tab, choose "Run whether the user is logged on or not" and also check the option "Run with highest privileges"
4. On tab "Triggers" enter the following:
-Click "New"
- Choose "Daily"
- Set the time when the backup should be made, then click "OK"
5. On tab "Actions" follow these steps:
- Click New.
- Make sure that you choose "Start a program"
- Choose in "Program" the bat file "backupdb.bat" , with his path.
- Click "OK"
6. On tab "Settings":
- Activate the option "Stop the task if it runs longer than:", and set it on "4 hours"
- Click "OK"
Note: You will be asked to login with windows login credentials. you can then log in with the current windows user, or choose another User
For the advanced Backup system of the Work-IT database, where you have the ability to backup your database for each day in a week and choose the right one to restore from, then please read this article:
EN - Advance backup Work-IT database