As part of our nightly server backup, we do the following to capture the logs, then clear out the logs, then take a full backup of the Tableau instance including the PG database.
Does this help?
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
tabadmin ziplogs -l -n -f %TABLEAU_BACKUP_PATH%%TABLEAU_LOG_FILE%%ldt%.zip #this takes a backup of the Tableau daily logs and appends the date onto it
tabadmin cleanup #cleans the http entries
echo STOP_tabsvc %date% %time% #Write down the stop time
tabadmin stop #stop
tabadmin cleanup # cleans the logs
tabadmin clearcache #clear the query cache
tabadmin start #start
tabadmin warmup #load vizql dll's
echo START_tabsvc %date% %time% #write down the start time. total duration is usually about 10 minutes
echo START_BACKUP_MAIN %date% %time% #write down the start backup time
tabadmin backup %TABLEAU_BACKUP_PATH%%TABLEAU_BACKUP_FILE%.tsbak -d #backup the Tableau environment. This includes the PG tables
echo STOP_BACKUP_MAIN %date% %time% #write down the stop backup time
Hey Jeff, why do you clear the query cache?
ah, that's the one experiment we have in here. Some users were complaining that they were getting stale data in the morning rather than getting fresh data from the extract. The external query cache is persisted even after a tabadmin restart, so we added this command in there to clear it out each night and start fresh.
Gotcha So that would mean your Server is set up as Refresh Less Often or to a custom Balanced period?
Refresh less often
Thank you for your reply. We do basically the same as you described.
There is bat file which is triggered every daily and does the same, backup of server, logs.
But I am looking for something like an archive database, where all records, even http request are stored for a long time- three years or so. So I am thinking about ETL which will do it for us, incrementally copying all new records to another postgres database, from which data will not be purged..
1 of 1 people found this helpful
yes. the script runs a tabadmin stop prior to tabadmin clearcache.
And if you really want all the PG history, then you can have an ETL job on the database of your choosing. Where I worked at previously, we created an SSIS SQL Server job that copied the internal PG database over to SQL Server.
Ok, I see. Thanks for all details!