V5 Strange behavior from backup database

Have noticed some strange behavior when backing up database with automation command button. After database gets backed up the custom navigation screen changes.

Here is my custom navigation screen before…

and this is the custom navigation after the backup has ran…

Notice how all the tiles have shrunk and moved… If i log out and back in all tiles are back to normal… not a huge deal… but just not sure if there is a reason for this.

1 Like

I believe tile positions are stored in the local settings file and not the database. I don’t use the navigation screen myself, maybe someone who uses them can confirm, but I am pretty sure that’s the reason.

I don’t think it is related to the way you backed up the database.

Mark is correct they are stored in layout files. You can even create custom layout files and have different layouts per user.

Yea I have copied that over to every profile… Weird thing is that when a message pops up while on the custom navigation screen it changes the layout to look like the bottom image. So it’s not because of the database backup action. It’s the pop-up message. If I log off and back on and then choose something else with a pop-up message it does the same thing… Must not be able to read the layout or something when message pops up.

Hope this better explains the issue.

Its as though it is clearing the Tile Cache from memory and not reading it back in after the backup. You might be able to overcome this with a Reset Cache Action or a Navigate Module Action immediately after the Backup completes.

Show your Action and Rule that you are currently using to execute the backup.

The first thing I would try is to add this Action after the DB Backup Action:

If that doesn’t work, you could try this Action in place of or in addition to the above Action:

Or you could simply force a Logout after backup which would force you to login again anyway …

Out of curiosity, if you use a Show Message Action instead of a Display Popup Action, do you experience the same issue?

Yea I tried that as well and i got the same behavior.

It must have something to do with the Backup Database Action itself.

I too have a button on main Nav screen to do a DB backup, but it does not use that Action; instead it uses a Start Process Action that fires a BAT file containing sqlcmd statements to perform the backup via the command line. I have a Show Message Action displayed afterward, and it does not mess up my Tiles, so it can’t be the message causing the issue.

##DBbackup.bat##

@echo off
cls

::
:: Set Path Information
::
::set pathSQL="D:\Programs\Microsoft SQL Server\120\Tools\Binn\osql.exe"
set pathSQL="C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\sqlcmd.exe"
set pathCOMP="C:\Program Files\WinRAR\Rar.exe"
set SERVERINSTANCE=localhost\SQLEXPRESS
set DBNAME=SambaPOS5
set pathBU=D:\Programs\POS\DBBU\
set pathNAS=\\NASWD3TB01\Private\BACKUPS\POS\DBBU\

::
:: Go to Backup Location
::
D:
CD %pathBU%

::
:: Set LOGFILE, ERRMSG, DateTime, BackupName
::
set LOGFILE=DBbackup.txt
set ERRMSG=

set dateTimeDB=%date%_%time:~0,2%%time:~3,2%%time:~6,2%
:: replace space with 0 :: @CALL set variable=%%variable: =0%%
@CALL set dateTimeDB=%%dateTimeDB: =0%%
set BackupName=%DBNAME%_%dateTimeDB%.bak
set CompressedName=%DBNAME%_%dateTimeDB%.rar


::
:: Start Logging
::
set dateTime=%date%_%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%
:: replace space with 0 :: @CALL set variable=%%variable: =0%%
@CALL set dateTime=%%dateTime: =0%%

@echo. >> %LOGFILE% 2>&1
@echo ******************************************************* >> %LOGFILE% 2>&1
@echo -- BAT BEG --------------------- %dateTime% >> %LOGFILE% 2>&1


::
:: Check parameters to ensure they are Ok
::
IF "%SERVERINSTANCE%" == "" set ERRMSG=%ERRMSG% ERROR:SERVERINSTANCE is BLANK
IF "%DBNAME%" == "" set ERRMSG=%ERRMSG% ERROR:DBNAME is BLANK
IF "%BackupName%" == "" set ERRMSG=%ERRMSG% ERROR:BackupName is BLANK
IF NOT EXIST %pathSQL% set ERRMSG=%ERRMSG% ERROR:pathSQL is Invalid
IF NOT EXIST "%pathBU%" set ERRMSG=%ERRMSG% ERROR:pathBU is Invalid
IF NOT EXIST %pathCOMP% set ERRMSG=%ERRMSG% ERROR:pathCOMP is Invalid
::IF NOT EXIST "%pathNAS%" set ERRMSG=%ERRMSG% ERROR:pathNAS is Invalid
set errorlevel=


::
:: If there is a problem with the given parameters, %ERRMSG% will contain a value, and we abandon the script
::
IF "%ERRMSG%" NEQ "" GOTO ERRORPROCESS


::
:: If parameters Ok, we continue...
::
@echo.
@echo DB Backup starting soon...
timeout 10
@echo.

::
:: Run BACKUP Commands
::

@echo -- DATABASE BACKUP BEG ------- %dateTime% >> %LOGFILE% 2>&1

@echo Backing up database [%DBNAME%] to %pathBU%%BackupName%
:: "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\osql.exe" -E -Q "BACKUP DATABASE mydatabase TO DISK='C:\tmp\db.bak' WITH FORMAT"
@echo sqlcmd.exe -S %SERVERINSTANCE% -E -Q "BACKUP DATABASE [%DBNAME%] TO DISK='%pathBU%%BackupName%'" >> %LOGFILE% 2>&1 
%pathSQL% -S %SERVERINSTANCE% -E -Q "BACKUP DATABASE [%DBNAME%] TO DISK='%pathBU%%BackupName%'" >> %LOGFILE% 2>&1 

@set dateTime=%date%_%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%
@CALL set dateTime=%%dateTime: =0%%

@echo -- DATABASE BACKUP END ------- %dateTime% >> %LOGFILE% 2>&1


::
:: Run COMPRESS Commands
::

@echo -- COMPRESS BEG ------- %dateTime% >> %LOGFILE% 2>&1

@echo Compressing %BackupName%
@echo Compressing %BackupName% to %CompressedName% >> %LOGFILE% 2>&1 
::rar a -ep -idcpd -m5 archivename filestoarchive
%pathCOMP% a -ep -idcp -m5 %pathBU%%CompressedName% %pathBU%%BackupName% >> %LOGFILE% 2>&1

@echo Deleting %BackupName%
@echo Deleting %pathBU%%BackupName% >> %LOGFILE% 2>&1 
del %pathBU%%BackupName%

@set dateTime=%date%_%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%
@CALL set dateTime=%%dateTime: =0%%

@echo -- COMPRESS END ------- %dateTime% >> %LOGFILE% 2>&1


::
:: Run COPY Commands
::

@echo -- COPY BACKUP BEG ------- %dateTime% >> %LOGFILE% 2>&1

IF NOT EXIST "%pathNAS%" set ERRMSG=%ERRMSG% ERROR:pathNAS is Invalid
IF "%ERRMSG%" NEQ "" GOTO ERRORNAS

@echo Copying %CompressedName% to %pathNAS%
@echo Copying %pathBU%%CompressedName% to %pathNAS%%CompressedName% >> %LOGFILE% 2>&1 
copy %pathBU%%CompressedName% %pathNAS%%CompressedName% >> %LOGFILE% 2>&1

@set dateTime=%date%_%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%
@CALL set dateTime=%%dateTime: =0%%

:ERRORNAS
IF [%ERRMSG%] == [] GOTO DONECOPY
@echo %ERRMSG% 
@echo %ERRMSG% >> %LOGFILE% 2>&1 
:DONECOPY
@echo -- COPY BACKUP END ------- %dateTime% >> %LOGFILE% 2>&1



::
:: We are almost done. Test for Errors.
::
IF [%ERRMSG%] == [] GOTO finished


:ERRORPROCESS
@echo %ERRMSG% 
@echo %ERRMSG% >> %LOGFILE% 2>&1 
@set dateTime=%date%_%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%
:: replace space with 0 :: @CALL set variable=%%variable: =0%%
@CALL set dateTime=%%dateTime: =0%%
@echo -- BAT END --------------------- %dateTime% >> %LOGFILE% 2>&1
:: Open the LOGFILE
@notepad %LOGFILE%
goto endoffile


:finished
@set dateTime=%date%_%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%
:: replace space with 0 :: @CALL set variable=%%variable: =0%%
@CALL set dateTime=%%dateTime: =0%%
@echo -- BAT END --------------------- %dateTime% >> %LOGFILE% 2>&1


:endoffile
@echo.
::
:: We are done.  Uncomment the following lines if you wish.
::

::@notepad %LOGFILE%

@echo DB Backup Complete.
timeout 2
::pause
2 Likes