Was this page helpful?
Yes No
Tableau Help > Tableau Server Help > 


Back Up Tableau Server Data

Backing up Tableau Server using the tabadmin backup command is an important part of proper administration and maintenance of your server. Only backups created with the tabadmin backup command can be used if you need to restore Tableau Server data.

The frequency of your backups depends on your environment, including how much use the server gets and how much and frequently the content and users change. Any changes or updates that happen after your backup will be lost if there is a system failure and you need to use the backup to restore Tableau Server. Keep this in mind when you determine how often you should be backing up your system.

In addition to your regular backups, you should always create a current backup of Tableau Server before upgrading to a new version.

Starting with Tableau Server version 9.3, an option to verify the integrity of the backup was included. Use this option to make sure there is no issue with the database that would result in your backup not being usable. For more information about the verify option, see Verify the Tableau Postgres Database.

Note: You should run tabadmin backup and other commands while logged in as the Run As user account for Tableau Server, or using an account that has administrative rights that include Modify permissions. For more information, see Run As Account Settings to Confirm in the Tableau Server Help.

In this article

Creating a regular backup

When you back up your Tableau data regularly, you can quickly restore published workbooks, data sources, and other information if there is a system failure. How often you create a backup depends on how heavily your Tableau Server is used. The more activity there is, the more often you need to back the server up.

Tableau Server data consists of Tableau's own PostgreSQL database, which contains workbook and user metadata, data extract (.tde) files, and configuration data. When you use tabadmin to create a backup, all these things are saved in a single file with a .tsbak extension. If you are running a distributed installation of Tableau Server you create the backup on the primary, and data from all the nodes is backed up.

For safety, after you create the backup, store the .tsbak file on a computer that is not a part of your Tableau Server installation.

Note: Running the backup command also removes Tableau Server log files older than seven days as well as some of the information displayed in certain Tableau Server Administrative Views.

  1. Open a command prompt as an administrator and navigate to the bin directory. For example:
                        cd "C:\Program Files\Tableau\Tableau Server\10.3\bin"
                    
  2. Create a backup file by typing tabadmin backup <filename>, where <filename> is the name or location and name of your backup file. Beginning with version 9.3, include the -v option to verify the integrity of the backup.

    Starting with version 8.1, there is no need to stop the server before you create the backup.

    For example:

    tabadmin backup tabserver -v

    or

    tabadmin backup C:\backups\tableau\tabserver -v

    You can also optionally use -d to append the current date to the file name.

    Add -t followed by a path, to specify a location for temporary files that are created during the backup process. The path for the temporary files is not the location where the backup file will be written. For example:

    tabadmin backup tabserver -t C:\mytemp\tableau

    In the above example, the backup file tabserver.tsbak will be created in the Tableau Server bin directory (C:\Program Files\Tableau\Tableau Server\10.3\bin) not in C:\mytemp\tableau.

    Note: The -v option is available beginning with version 9.3 and verifies the integrity of the backup. After creating the backup, tabadmin verifies that the file can be used to restore the database. for more information, see Verify the Tableau Postgres Database

Creating a pre-upgrade backup

You should always create a backup before upgrading Tableau Server. Starting with version 10.0, Tableau Server Setup offers to create a backup before upgrading to a new version. If you have created a backup yourself, before the upgrade, you can choose to skip this and save time during the upgrade. You can create a backup while Tableau Server is running and minimize the amount of time the server is unavailable during upgrade. For more on the backup option during upgrade, see Tableau Server Upgrade Backup Options.

The process for creating a pre-upgrade backup is the same as for creating regular backups, with one additional consideration for distributed installations.

The Tableau backup file (.tsbak) includes configuration information as well as data. Therefore, a backup of a distributed installation of Tableau Server will include configuration information about the worker nodes, including their IP addresses. If you don’t want this information as part of your backup (for example, because you are creating the backup for a test deployment, or will be migrating worker nodes to new hardware as part of your upgrade), you can do one of two things:

  • Plan on using the --no-config option when you restore the backup file to your new installation. With this option, no configuration information is restored, including configuration information for the primary Tableau Server node.

  • Remove the workers from the Tableau Server configuration before creating the backup.

Note: You should uninstall Tableau Server from any workers that you are not including in your new installation to avoid conflicts between the older workers and the new installation.

Scripting the backup process

If you back up often, you might want to create a script that performs the backup and related tasks for you. These tasks include:

  • Saving log files that are older than seven days if you do want to keep them, or conversely, removing log files that you don't want to back up.

  • Running the backup itself.

  • Copying the backup file to a separate computer for safekeeping.

  • Verifying that the server is running after the script is finished.

This section discusses tabadmin commands and Windows commands that you can use together to perform a backup and related tasks.

Save logs before cleanup

Performing a backup removes log files that are older than seven days. If you want to preserve the logs before the backup, run the following command before you start the backup:

tabadmin ziplogs -l -n -f

Remove log files and clear temporary folders

You can clean old log file and temporary files from your Tableau Server computer to reduce the time it takes to create a backup, and to ensure the backup file is as small as possible.

To clean log files older than a few days, run the following command:

tabadmin cleanup

If you run this command while the server is running, the command performs cleanup on log files and temporary folders that are not currently in use. To remove all Tableau Server log files and clear temp folders, stop the server first. This lets the cleanup command remove log files that might currently be open. The sequence of commands for a full cleanup is this:

tabadmin stop
tabadmin cleanup
tabadmin start

Run the backup

To create the backup, use the tabadmin backup command:

tabadmin backup <backupfilename> -d -v

Note the following about the command:

  • Include the -v command option to verify the integrity of the backup.

  • Add -d to the command to include the date in the file name.

  • For the <backupfilename> value, you can specify a path and filename if appropriate. If you specify only a filename, the backup file is saved in the current directory (the Tableau Server bin directory.

  • If you don't specify a filename extension, Tableau adds the .tsbak extension.

Copy the backup file to another computer

As a best practice, after the backup is finished, copy the backup file and any saved log files to another location that is separate from Tableau Server. To do this, use the Windows copy command:

copy <original_backup_path_and_filename> <network_drive_or_other_location_path_and_name>

Verify Tableau Server restart

You can use script commands to verify that the Tableau Server is running after the backup process has completed and you've run a tableau start command. If the server does not start, you can have the script run a command that sends an email to the administrator. However, before checking the server status, allow enough time for Tableau Server to finish its initialization. You can do this in a script by including a timeout command in the script. In the following example, the timeout command waits 90 seconds before continuing:

timeout /t 90
if tabadmin status != 'RUNNING' then <code_to_email_an_alert>

Complete example script

The following is an example script combining logs, backup, cleanup and alerting capabilities.

tabadmin ziplogs -l -n -f
copy logs.zip <path_and_filename>
tabadmin backup <backupfilename> -d -v
copy <original_backup_path_and_name> <other_location_path_and_name>
tabadmin cleanup
timeout /t 90
if tabadmin status != 'RUNNING' then <code_to_email_an_alert>

Scheduling a scripted backup

To run backups regularly, you can use the Windows Task Scheduler to schedule when to run it.

  1. Sign into Windows using the Run As user account or another account that has administrator permissions for the server computer.

  2. Click the Windows Start menu and search for "schedule".

  3. Right-click Task Scheduler and then click Run as administrator

  4. Follow the Windows Task Scheduler wizard to complete the setup. As the command to run, specify the name of the command file that contains the backup script.

For more information, see Task Scheduler How To in the Microsoft TechNet library.