12 Replies Latest reply on Nov 28, 2016 9:02 AM by Toby Erkson

    Automatic Server Backups

    Lee Murphy

      I'm trying to implement automatic backups on my Tableau servers.  I'm referencing the information located here:



      I'm using the server's task scheduler to create the schedule. I see that the script should be inserted on the Ations tab.  Am I supposed to just type the commands in Notepad and then save the file in the Tableau bin directory? (The instructions don't say.)   

        • 1. Re: Automatic Server Backups
          Jim Wahl



          You'll want to save the commands (using a text editor) in a batch script (.bat) or powershell script (.ps1). And then run this script from Windows scheduler. I save the script in a scripts directory, but if you save it in the Tableau bin directory you wouldn't have to use the cd command below.


          Powershell enabled me to more easily upload the backups to Amazon S3, which might be interesting to you or someone else. You can see my script below and attached. Since I'm storing the backups on another machine, I keep only the last file on the server, but you could also add a command in Powershell to delete backups older than X days.


          Another tip is that if you have email alerts setup in Tableau Server, you'll get an email notification when the server is back online.




          # Tableau Backup

          # see http://kb.tableausoftware.com/articles/knowledgebase/server-maintenance


          # Creates two backup files, one date-stamped, one with a standard name to facilitate automated restore

          $name = Get-Date -uformat "tabbackup_%Y%m%d-%H%M.tsbak"

          $name_last = "tabbackup_last.tsbak"

          $bakdir = "C:\Program Files (x86)\Tableau\Tableau Server\7.0\backups"


          # Backups are uploaded to Amazon S3

          $key = "XXX"

          $secretkey = "XXX"

          $s3folder = "XXX"


          cd 'C:\Program Files (x86)\Tableau\Tableau Server\7.0\bin'


          # Create backup directory if it doesn't exist

          new-item $bakdir -Force -Type Directory


          # Backup script

          .\tabadmin.bat stop

          .\tabadmin.bat backup $name


          # Restart Tableau

          # Run tabadmin cleanup both before and after running tabadmin start to clean all log locations.

          .\tabadmin.bat cleanup

          .\tabadmin.bat start

          .\tabadmin.bat cleanup


          # Move backup files to backups folder

          move-item $name $bakdir\$name

          copy-item $bakdir\$name $bakdir\$name_last


          # Upload to S3

          Add-PSSnapin CloudBerryLab.Explorer.PSSnapIn

          $s3 = Get-CloudS3Connection -Key $key -Secret $secretkey

          $destination = $s3 | Select-CloudFolder -path $s3folder

          $src = Get-CloudFilesystemConnection | Select-CloudFolder $bakdir

          $src | Copy-CloudItem $destination –filter $name

          $src | Copy-CloudItem $destination –filter $name_last


          # Cleanup -- delete the date-stamped file, since it's been uploaded.

          remove-item $bakdir\$name

          2 of 2 people found this helpful
          • 2. Re: Automatic Server Backups
            Toby Erkson

            On our server I use the Windows Task Scheduler to execute the attached DOS batch file.  The backuped files are stored in the .../Tableau/backups directory and the batch files reside in the .../Tableau/Scripts directory, both of which I created.


            The scheduler simply points to where ever your script is located.  It is up to you to provide the file path that gets to tabadmin.  To help things along, I also added the bin path to my "Path" environment variable:



            (Correct, that path isn't the stock default, it's one the company I work for requires).  Now I don't have to worry about being in the bin folder when executing tabadmin commands -- nice

            3 of 3 people found this helpful
            • 3. Re: Automatic Server Backups
              Kyle B

              Thanks Toby - I added the following to rotate the logs, but otherwise your script worked for me without modification:


              ECHO Rotating backups older than 10 days...
              forfiles /P "%sPath%" /S /M *.tsbak /D -10 /C "cmd /c del @PATH"
              ECHO Rotating log zips older than 10 days...
              forfiles /P "%sPath%" /S /M *.zip /D -10 /C "cmd /c del @PATH"
              1 of 1 people found this helpful
              • 4. Re: Re: Automatic Server Backups
                Toby Erkson


                Glad it helped.  Attached is an updated version that now works with the check on the server if running bit.

                Also attached is the restore script.  A back-up isn't much good if ya can't use it!

                3 of 3 people found this helpful
                • 5. Re: Automatic Server Backups
                  Mark Mitchell



                  Thanks for sharing your scripts.  I am new to Tableau admin as well as to Windows scripting and have been working to come up with just this!!  You've saved me a lot of work.

                  • 6. Re: Automatic Server Backups
                    Toby Erkson

                    Awesomeness, glad it's helpful

                    • 7. Re: Automatic Server Backups
                      Jeffrey Lutomski

                      I have used a similar script to backup the logs to a file share and also the data into a .tsbak  file.


                      But when I use the script to generate the logs.zip Tableau says its missing the config\workgroup.yml

                      I am not sure why.


                      When I run the command just on the regular bin directory live on the server tabadmin ziplogs all the files are there correctly. Maybe its a file share or other permissions error?


                      Also do you guys know of any way the checks the integrity of the .tsbak files?

                      Before you need to restore. If you generate backups, test the backups work at first or once in a while, what happens it the 10th backup you restore from is actually corrupted and you cannot bring you data or server back??


                      I would be nice if there was something that could verify the backup files are good or not corrupted.

                      Like if you try to restore from something this outputs to the command line.



                      ===== Beginning to restore the backup


                      ===== Verifying backup manifest

                      Please enter the password for the <insert Tab admin account here>:

                      ===== Initializing Tableau Server File Store Remotely

                          --Initializing built-in extract engine data restore.

                          --Restoring service data from backup file

                          --Database restore completed

                          --running migrations

                      ===== Validating Database schema signature

                      ===== Schema Signature is valid

                      ===== Initializing Tableau Server Coordination Service


                        --Web data connectors were distributed to all gateways   

                        --Web data connectors restore completed

                      ===== Building search index

                      ===== Search index Built

                      ===== Backup restore completed



                      At least something that does the Verify backup manifest??

                      • 8. Re: Automatic Server Backups
                        Jeffrey Lutomski

                        What is cool is Tableau Server v9.3 is probably going to have a verify command for the backups.

                        • 9. Re: Automatic Server Backups
                          Jagjit Singh

                          Hi Toby,


                          Thanks for sharing the script. I wanted to know if the tabadmin utility will automatically find the tableau data folder or do we need specify the data folder path in the scrip. My data folder is located in C:\ProgramData\Tableau\Tableau Server\data




                          • 10. Re: Automatic Server Backups
                            Toby Erkson

                            Jagjit, why?  It should but maybe it depends on what you want.  Does this have to do with back-ups?

                            • 11. Re: Automatic Server Backups
                              Adam Adam

                              Hi Toby,


                              I am not able to open your attached file:

                              instead of open so I can see the scrip, I get the option to Run:



                              Any advise please?


                              Thank you

                              • 12. Re: Automatic Server Backups
                                Toby Erkson

                                What browser are you using?

                                Try right-clicking on each file and see what options you have.  In Firefox there is "Save Link As..." which allows you to save the file:





                                1 of 1 people found this helpful