On-Premises Windows Back Office Backup Utility
Overview
This document covers the configuration specifics of setting up the on-site backup utility. The purpose of the utility is to create a DB backup to the second hard drive installed on the physical machine, so in the event of a primary drive failure a recovery of data is possible.
Note: Confirm that a second hard drive is present on the physical machine before performing the steps below.
Backup Script Files
File Description | File Link |
---|---|
Direct link to the Dropbox location for the backup script. Download and copy the file to the site. | https://www.dropbox.com/scl/fi/35ewur0n921equsce69ks/backup.zip?rlkey=a2uluzaldqbnafmxevlf3nufm&st=cz2tit90&dl=0 |
Updated |
|
README.txt
The backup.bat is a batch file that backs up the following files from the Volante backoffice.
C:\volanteHome\database\volanteBOTrans.db C:\volanteHome\database\volanteBOMain.log C:\volanteHome\database\volanteBOMain.db C:\volanteHome\database\volanteBOCust.db C:\volanteHome\database\volanteBOAuditLogs.db
These files are responsible for storing your server's menu,customer information and transaction history.
Transaction history is based on the premise that a POS was succesful in synchronizing the transactions to the server prior to the time of the backup.
Running the batch file makes a copy of the above files in the following folder:
C:\volanteHome\backup\1\
When running the backup, \1\ is migrated to \2\, \2\ is migrated to \3\, and \3\ is migrated to \4\. \4\ is migrated to \5\ and then immediately deleted. This way the four most recent backups are saved.
Using BACKUP.BAT
It is recommended this backup runs weekly so that 4 weeks of backups are always stored per month. When running the batch file in command-line, it's possible to pass an argument to redirect the files copied to a folder of your choice ( backup.bat <custom file path>)
C:\volanteHome\backup.bat D:\VolanteBackup
When running the batch file in Task Scheduler, you can include the argument for the custom file path.
Note: Confirm that a second drive is present in the physical machine. The backup utility should export the files to the second physical drive, which is installed expressly for the purpose of backing up the BO database files.
Code
The following code is included in the backup.bat script file
@ECHO ON REM -- Prepare the Command Processor SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION SET VOLANTEHOME=C:\volanteHome SET SYBASE_11_BIN=%VOLANTEHOME%\vbin\sybase\sybase11\BIN32 SET DBBULOGFILE=%VOLANTEHOME%\logs\dbbackup.log IF [%1] == [] (SET BACKUPPATH=%VOLANTEHOME%\backup) ELSE (SET BACKUPPATH=%1) SET DB_DSN_BO=volante_backoffice REM -- Collect Date Info IF %date:~0,1% == 2 ( SET dayStr=%date:~8,2% SET monStr=%date:~5,2% SET yeaStr=%date:~2,2% )ELSE ( SET dayStr=%date:~7,2% SET monStr=%date:~4,2% SET yeaStr=%date:~12,2% ) ECHO ================================================================================= >>%DBBULOGFILE% ECHO DBVALID, log@%DBBULOGFILE% ECHO %Date% - %Time:~0,5% DBVALID started >> %DBBULOGFILE% %SYBASE_11_BIN%\dbvalid -c "dsn=%DB_DSN_BO%" -t -o %DBBULOGFILE% ECHO %Date% - %Time:~0,5% DBVALID done >> %DBBULOGFILE% ECHO DBVALID SUCCESS >> %DBBULOGFILE% REM -- IF to either backup or not. IF %ERRORLEVEL% NEQ 0 ( ECHO NOT BACKING UP================================================================================= PAUSE exit 0 ) ECHO ================================================================================= >>%DBBULOGFILE% REM -- Rotate Backup Folders SET count=5 FOR %%G IN (4 3 2 1) DO (call :subroutine %%G) MD %BACKUPPATH%\1 REM -- DB Backup Local echo DBBACKUP >> %DBBULOGFILE% echo %Date% - %Time:~0,5% DBBACKUP started >> %DBBULOGFILE% %SYBASE_11_BIN%\dbbackup -c "dsn=%DB_DSN_BO%;LINKS=ALL" -o %DBBULOGFILE% -y %BACKUPPATH%\1\%yeaStr%%monStr%%dayStr% echo %Date% - %Time:~0,5% DBBACKUP done >> %DBBULOGFILE% ECHO ================================================================================= >>%DBBULOGFILE% REM -- Remove oldest backup RD /s /q %BACKUPPATH%\5 GOTO :eof :subroutine cd %BACKUPPATH% ren %BACKUPPATH%\%1 %count% SET /A count-=1 GOTO :eof