Backing up Using tabadmin
Proper administration of your Server requires regular backups. This can be done using the tabadmin command. However, this is only available on your Tableau Server. So, the first step is to Remote Desktop into your Server with Tableau Server installed.
Once you have made your remote desktop connection, open the Command Prompt. Navigate to the directory that contains the tabadmin executable. You can use cd followed by the directory path to get there. For instance,
cd "c:\Program Files\Tableau\Tableau Server\10.2\bin"
Notice how the command prompt changes from,
C:\Users\Administrator> to c:\Program Files\Tableau\Tableau Server\10.2\bin>
depending on which folder you’re in, or which is your present working directory.
we get a list of all the files inside the present working directory, and we should see that tabadmin is listed. A fundamental command for checking the status of Tableau Server is,
tabadmin status -v
which should return a list of all the processes that are (ideally) running as such,
Status: RUNNING 'Tableau Server Coordination Service 0' (2812) is running. 'Tableau Server Search and Browse 0' (2824) is running. 'Tableau Server Tabadmin Service 0' (2836) is running. 'Tableau Server Data Engine 0' (2908) is running. 'Tableau Server Application Server 0' (2932) is running. 'Tableau Server Backgrounder 0' (2956) is running. 'Tableau Server Backgrounder 1' (3004) is running. 'Tableau Server CacheServer 0' (3028) is running. 'Tableau Server Dataserver 0' (3060) is running. 'Tableau Server Vizqlserver 0' (2408) is running. 'Tableau Server Gateway' (2992) is running. 'Tableau Server Cluster Controller' (3260) is running. 'Tableau Server Repository' (5756) is running (Active Repository). 'Tableau Server File Store' (3452) is running.
Now that we know our server is working properly it’s time to backup. You do not need to stop the server for this, but Tableau recommends that you stop and restart the server on a weekly basis to free up RAM. When we make our backup we have to provide a directory path that indicates where we want to save the file. I have created a Temp folder on the C:\ in which to save my backup and I call it ts_backup.
To create a backup type,
tabadmin backup C:\Temp\ts_backup -d
The switch -d appends the current date to the name of our backup file. This is useful to denote when the backup was made.
Pressing enter should produce,
c:\Program Files\Tableau\Tableau Server\10.2\bin>tabadmin backup C:\Temp\ts_backup -d ===== Using as backup tmp directory: C:/ProgramData/Tableau/Tableau Server/data/tabsvc/temp (free space: 1.04 TB) ===== Setting inheritance on C:/ProgramData/Tableau/Tableau Server/data/tabsvc/pgsql/data ===== Setting inheritance completed on C:/ProgramData/Tableau/Tableau Server/data/tabsvc/pgsql/data ===== Cleaning entries from http_requests log older than 7 days -- Deleted 0 rows ===== Backing up database data with tblwgadmin ===== Backing up dataengine extracts ===== Backup of database data done ===== Backup of dataengine extracts done ===== Backup written to C:/Temp/ts_backup-2017-03-15.tsbak
And, hey presto! Our backup has been created and we can see this file if we navigate to the C:\Temp folder. It will be called something like ts_backup.tsbak. This is actually a zip file, and if we wanted to we can rename the file ts_backup.zip and double click to open it up. When we look inside we will see that it contains everything including: extracts, a repository database and configuration yml files.
If our Tableau Server crashes for whatever reason, we may wish to restore a previous version. This is easily accomplished by typing,
tabadmin restore [filepath]
Automating Tableau Server Backups
So now we know how to produce a backup of our Tableau Server. Except, we want to create these backups at set intervals so that when and if the server crashes, we have a relatively up to date backup. We can automate this process by writing a batch file. Open a text editor (such as notepad) and copy and paste the following text,
:: This is a batch script to automate backups @echo off :: This stops the output to the command line tabadmin stop tabadmdin backup C:\temp\ts_backup -d tabadmin start
And save the file as backup.bat. The next stage is to create a new task using Microsoft Task Scheduler which will automate this with a frequency, and at a time of your choosing. It is recommended to have this script at night on a weekend during an IT maintenance window to minimise disruption to users on the Server.