14 Replies Latest reply on Oct 2, 2018 6:16 AM by Toby Erkson

    Backing up Tableau

    System Administrator

      I asked support but no-one responded.  I thought I'd fixed it myself but it still doesn't work.  I have 'upgraded' from 10.1 to 2018.2 – I can log in to Tableau and everything is still there.  The last thing on my list is reinstating the backup, which has changed from the old tabadmin command.  I was struggling with the backup - dreadful documentation, you have to use the command line, you can't change the location Tableau backs up to and there are conflicting instructions in the help.

       

      This works:

      tsm maintenance backup --file backup.tableau --append-date

      They go in C:\ProgramData\Tableau\Tableau Server\data\tabsvc\files\backups.  Then you have to copy the backup to wherever you want them to be stored yourself.  Beware when testing - it won't overwrite existing backup files.

       

      Except it still won't work on a scheduled task.  When I run the command above it asks for a password so the scheduled task hangs until it gives up.

       

      I don’t want to leave the password laying around in a batch file.  How do I get the backup to work without a password?

       

      This used to be easy.  Why is it so complicated now?

       

      (While I'm at it, I'd like to know why TSM closes the command prompt window when it finishes one command despite my script having several commands.)

        • 1. Re: Backing up Tableau
          Donna Coles

          Hi there

           

          It would be useful if you could clarify which version of Tableau Server you're referring to.

          Have you had a previous instance when it worked fine, and if so what version was that and how did you manage it.

           

          Providing this information will help others help you.

          Regards

          Donna

          • 2. Re: Backing up Tableau
            Stuart Kinnear

            Hi Donna

             

            I have the same issue.

             

            I am using 2018.2

             

            Thanks

             

            Stuart

            • 3. Re: Backing up Tableau
              Toby Erkson

              The exact version would be helpful e.g. 2018.2.1.

               

              Please see this document regarding passwords with TSM:  Tips for running scripts with TSM on Windows

              2 of 2 people found this helpful
              • 4. Re: Backing up Tableau
                System Administrator

                TableauServer-64bit-2018-2-1

                 

                I don't want to put the password in the batch file, it's not secure.  How do I run the backup without using a password?

                • 5. Re: Backing up Tableau
                  Toby Erkson

                  You can't.  A password is required.

                  • 6. Re: Backing up Tableau
                    Stuart Kinnear

                    Tableau Services Manager command line version 20182.18.0627.2230.

                    Tableau Server version 20182.18.0627.2230.

                     

                    Thanks

                    • 7. Re: Backing up Tableau
                      System Administrator

                      What does the account need access to?  Surely I'm not going to be forced to ignore security rules to back up your software?  Can I add an account to Tableau which can just do the backups?

                      • 8. Re: Backing up Tableau
                        Toby Erkson

                        Version 2018.2.x is really different so we can't really say why it does what it does.  It would be best to contact Tableau support about this.  Then you can come back and let us know if why and if there is another solution.

                        • 9. Re: Backing up Tableau
                          Hardik Soni

                          Hi there,

                           

                          I had a same issue but tableau support did not help me modified my script. i was able to figured it out. I have attached Backup, Cleanup and Archive-logs text files. Save those 3 files as .cmd and replace the username and password.

                          I would recommend that you use the following orders to schedule your scripts.

                          1. Backup script

                          2. Cleanup script

                          3. Archive-logs script.

                           

                          Get the current file location for backups:

                          tsm configuration get -k basefilepath.backuprestore

                           

                          Change the file location for backups:

                          tsm configuration set -k basefilepath.backuprestore -v "/new/directory/path" 

                           

                          Get the current file location for ziplogs:

                          tsm configuration get -k basefilepath.log_archive

                           

                          Change the file location for ziplogs:

                          tsm configuration set -k basefilepath.log_archive -v "/new/directory/path"

                           

                          After you change a default file location you need to do the following:

                              1. Apply pending changes:

                              tsm pending-changes apply

                           

                              2. Stop Tableau Server:

                              tsm stop

                           

                              3. Restart the TSM Controller (as tableau system account):

                              sudo su -l tableau -c "systemctl --user restart tabadmincontroller_0.service"

                           

                              4. Wait several minutes for the controller to restart. You can confirm the controller has restarted with this command:

                              tsm status -v

                           

                                 When you can run that command and the Tableau Server Administration Controller is listed as 'running' the controller has restarted.

                           

                              5. Start Tableau Server:

                              tsm start

                           

                           

                          Hope this helps.

                          • 10. Re: Backing up Tableau
                            System Administrator

                            Support don't respond to emails or tickets.

                            • 11. Re: Backing up Tableau
                              Toby Erkson

                              The speed at which they respond depends upon the priority assigned and also depends on the support contract (something like basic or premium).  You can submit support tickets through your customer portal.  If Tableau Support hasn't responded in a day or two from your initial request then you need to let your sales representative know.

                              • 12. Re: Backing up Tableau
                                System Administrator

                                I don't get on with PowerShell.  Why do I have a GUI?  If I wanted to do everything on a command line why would I use Windows?  Anyway, not liking it doesn't fix things.

                                 

                                The answer is in the link Toby Erkson gave, on Lisa Guillet's page.  Support also pointed me at it so I gave in and read it properly.

                                 

                                I used the first bit of PowerShell to create cred.sec so I don't have to leave the password in plain text, then created a script like this:

                                 

                                $FilePath = "c:\batch\cred.sec"
                                $Username = "Domain\Admin"
                                $encryptedCred = Get-Content $FilePath | ConvertTo-SecureString
                                $cred = New-Object System.management.Automation.PsCredential($Username, $encryptedCred)
                                $Pass = $cred.GetNetworkCredential().Password

                                tsm maintenance cleanup -u "$Username" -p "$Pass"
                                tsm maintenance backup -f backup.tableau -d -u "$Username" -p "$Pass"
                                tsm settings export -f "C:\ProgramData\Tableau\Tableau Server\data\tabsvc\files\backups\settings.json" -u "$Username" -p "$Pass"
                                & 'c:\batch\archive.bat'

                                 

                                The batch file at the end copies the backup files to another location and I have a scheduled task "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass c:\batch\script.ps1".  Now all I have to do is update cred.sec when I change the password.

                                2 of 2 people found this helpful
                                • 13. Re: Backing up Tableau
                                  Donna Coles

                                  Thanks for sharing your solution.  I'm sure it'll help others when they come to upgrade/migrate.

                                  Donna

                                  • 14. Re: Backing up Tableau
                                    Toby Erkson

                                    Thanks for explaining what you did, this will help me when I eventually move to 2018.2.x.