Restoring corrupted database

Applicable to:    TimeGuard Network | TimeGuard Pro



Database backup mechanisms



Automatic database backup mechanism:

TimeGuard automatically creates backups of the database. TimeGuard also compacts and repairs the database regularly to ensure that it's in top condition. The backups directory is normally located in the database directory, however, you can specify a different path.
Note: the path must be visible to all the stations.
When TimeGuard is used, a new copy of the database is created about every 2 hours. There are 3 backups for the current workday, and additional backups for the last 7 (or more) workdays, depending on TimeGuard's usage.  TimeGuard automatically refreshes the backup files on a regular basis. The first backup file in, is the first backup file out (FIFO).


Manual database backup:

It is recommended to backup the database to a safe location from time to time, preferably to another PC or external storage device.
To backup the database manually perform the following steps:

  1. Right click and in the navigation pop up select 'Activity & Billing Reports...'. 'TimeGuard Reports' window will open.
  2. Under the 'File' menu, select 'Backup Database Manually'. The 'Browse For Folder' dialog will appear.
  3. Select the desired path in the 'Browse For Folder' dialog and click the 'Ok' button. A message will confirm the completion of the backup operation.

Compacting the database:

TimeGuard compacts the database if at least one station is turned ON, and the database is not accessed by any station for at least one hour.
It is also recommended to compact the database manually every week or two.
To compact the database manually open the 'Managers Tools' window, and under the 'Edit' menu select 'Compact And Repair Database...'.
Before compacting the database make sure that TimeGuard is not used by any user.

 

Restoring a database backup

In the remote event of database corruption, you can restore the latest database backup and resume business quickly.
Note: Before doing any database operation, it is highly recommended to make a full copy of the current database, and the database backups directory.


If TimeGuard is able to start normally, follow this procedure:

  1. Right click and in the navigation pop up select 'Activity & Billing Reports...'. 'TimeGuard Reports' window will open.
  2. Under the 'File' menu, select 'Recover Database From Backup'. The 'Open' dialog will appear.
  3. The last database backup is stored in the directory 'Backup_Db_0_Work_Days_Ago_A'   (the name of the backups directories shows their chronological order). Double click this directory to open it.
  4. Inside the directory locate the 'TgDb4.mbd' file and select it.
  5. Click the 'Open' button. TimeGuard will ask you to confirm the operation twice, and then close.
  6. Start TimeGuard.

If TimeGuard cannot start, follow this procedure:

  1. Use windows explorer to open the backups directory. Usually it is located inside the database directory.
    (If you are NOT using TimeGuard over a network, it would most liekly be in:  'My Documents\TimeGuard 4\Backup_Db')
  2. Inside the backups directory find the 'Backup_Db_0_Work_Days_Ago_A' directory. Double click this directory to open it.
    (Note: The name of the backups directories shows their chronological order).
  3. Inside this directory locate the 'TgDb4.mdb' file.
  4. Copy the file to the database directory.
  5. Start TimeGuard.
  6. If the database is still corrupt, perform steps 1 - 5 again, using the backup file that is located in the next directory.