EN - Advance backup Work-IT database

EN - Advance backup Work-IT database

Question

How to back-up the Work-IT database automatically each day weekly or for a couple of days weekly?

Answer 


Sometimes it is more secure for our valuable database to have weekly 7 backups (or less) instead of one backup file that will be overwritten every day!
which could lead to the loss of the database if the current backup file didn't save directly in a different place and is not overwritten with the backup of the crashed database.
So with the advanced backup system, you will have the choice to restore your database from any 7 (or less) backup files that you have from the previous week.


Before we start explaining the backup options in this batch files let's make sure that we create those 3 folders in the drive where we want to save the backup files (for example c: drive)
1C:\Work-IT_Backup

2- C:\Work-IT_Extra_Backup
    then create those 7 folders in this folder (All weekdays)
            - Monday
            - Tuesday
            - Wednesday
            - Thursday
            - Friday
            - Saturday
            - Sunday

3- C:\Work-IT_Extra_Backup_temp

Then unzip the two files( backupdb.batbackupdb.sql )in the attached zip file to the folder C:\Work-IT_Backup

Actually here we will use another batch file than the one in the article:

EN - Backup Work-IT database

This advanced batch file (backupdb.bat), you can find in the attached zip file, the following screenshot gives an overview of the commands in this advanced batch file:



As you can see, the batch file will make a backup file first in the folder C:\Work-IT_Backup, then he will zip the backup file and move it to the right weekday folder according to the day of running the batch file.
And after the first week, you will have extra backup files for each day in the week, each one in its own folder in the path C:\Work-IT_Extra_Backup.
So that you can go back and restore the right good backup file from a day of the previous week where you think that the database was successful.

As you can see from the screenshot above, you can let the system make extra backup files for only two days (for example on Monday and Thursday) instead of all 7 days of the week, here we need to make the right modification in the batch file.
With this modification, you need less saving space in the drive than if you make 7 backup files on all weekdays, so as you can see we can customize this batch file according to your needs.

After making the right changes in the batch file, you can use " Task scheduler " in Windows to let him run the batch file daily in a cerian time by following these steps:

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 "Actionsfollow 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 to "4 hours"
   - Click "OK"




NoteYou will be asked to log in with windows login credentials. you can then log in with the current windows user, or choose another User






Finally:
You must always keep controlling whether the batch file runs properly or not and whether the Task scheduler runs this batch file properly or not.



Please contact our Work-IT support team to help you set up this advanced backup system with the modifications that suit your needs.







    • Related Articles

    • EN - Backup Work-IT database

      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" ...
    • EN - Installing SQL Server and Work-IT

      How do I install SQL Server and Work-IT ? Installation manual SQL Server and Work-IT This manual is to help you with the installation and setup for the software you need to use Work-IT You'll need the installation folder with the following content: - ...
    • EN - Work-IT: Setup Course - Basic

      Question How to start quickly with Work-IT?  Answer   If you want to get to know how to setup Work-IT, you can do the free online course in the Hoogendoorn AcadeMe.  But if you want to have a quick look at the videos about Work-IT then click the ...
    • EN - Using the interface of Work-IT

      I am new to Work-IT. Can you give some tips and tricks on how to use the program? We want to make working with Work-IT as easy and fun as possible. Have a look at the video below for some trips and tricks. Want to learn more about how to work with ...
    • EN - Creating a report in Work-IT

      How do I create a new report in Work-IT? You can create a  new report in Work-IT in several ways. Each tab of Work-IT has its report button from which you can start a report. The video below shows an example of how to setup a simple report. This can ...