5 Replies Latest reply on Dec 3, 2014 1:21 AM by kumar.c

    tabcmd to publish workbooks with database server name & port as a parameter

    Nitin Agarwal

      Hi,

      I have created a workbook (.twbx) having some data extracts and some live connections to the SQL Server database.

      I am able to successfully publish this workbook on Tableau Server using tabcmd in development environment.

      Now my question is how to publish this workbook on Tableau Server using tabcmd on client machines (production) where database server name is different from the development. Seems like during publishing Tableau is trying to make a connection to the database server and throwing error since it could not find that same server (that was used in development). I can pass the database user id and password as parameter in tabcmd but how to pass database server name and port?

       

      Tableau Desktop should be required only during development. It should be not be required for production deployment.

       

      Regards,

      Nitin

        • 1. Re: tabcmd to publish workbooks with database server name & port as a parameter
          Dan Huff

          Nitin--

           

          This can easily be fixed by doing the following:

           

          1. Open the workbook in Tableau Desktop
          2. Connect to the production database/table(s)
          3. Click Data in the toolbar and then Replace Data Source
          4. Replace the development data source with the production data source

           

          This will swap the connections out and keep all of your existing work assuming that the fields are named the same. From here, since the workbook now connects to the production database, you should be able to use tabcmd to publish the workbook to server.

           

          Hope this helps,

           

          Dan

          • 2. Re: tabcmd to publish workbooks with database server name & port as a parameter
            Nitin Agarwal

            Thanks for the response Dan. No offense but, it is like we are asking our clients to open the code in the code editor (which costs $2000), modify the connection string in the code before you can deploying it on Tableau Server (and hey make sure you accidentally don't change anything else while doing this change as you might have to unhide some sheets in the process).

            I am from the old school where connection string goes in the configuration file, so I find this little weird.

             

            Anyways, if I have no choice but to use Tableau Desktop, than why would I use tabcmd to publish. I will use Desktop for publishing as well.

             

            Idea was that I will create the dashboard once and distribute to N clients along with publishing script. They just have to update database connection properties in the script (using any text editor) and run the script to publish the dashboards on the Tableau Server.

             

            My original question is still valid "How to publish one dashboard to different clients without using Tableau Desktop?".

             

            Hope this is not too demanding.

             

            Thanks,

            Nitin

            • 3. Re: tabcmd to publish workbooks with database server name & port as a parameter
              Nay Lin Soe

              Hi Nitin,

               

              I'm in exactly the same situation as yours. Design once, and deploy it to multiple sites (which differ only in server name and database name in my case). You can't set it with tabcmd, but only in the workbook. Fortunately, the workbooks (twb) files are in xml format. If you open any twb file in a text editor and search the word 'server=', you will find the bit which specifies the server and the database for each connection.

               

              So in my case, I developed my own little tool (.exe) which essentially examines the text content of twb files and replaces with desired values at those spots. If you are distributing a publishing routine, the routine needs to include the bit to manipulate the twb files. That's my approach.

               

              Nay

              • 4. Re: tabcmd to publish workbooks with database server name & port as a parameter
                Lester Anciro

                "How to publish one dashboard to different clients without using Tableau Desktop?"

                 

                You may try this one.

                 

                tabcmd login -u admin -p admin --site Client1

                 

                tabcmd publish sample1.twbx -o

                tabcmd publish sample2.twbx -o

                 

                echo *FINISH*

                • 5. Re: tabcmd to publish workbooks with database server name & port as a parameter
                  kumar.c

                  Hi Nitin,

                   

                  There is one solution where right click on the workbook (.twb) and open with notepad then it will show the XML code in that replace the servername, username and password with the production details and save the file and publish the .twb file from tabcmd and give the --db-username & --db-password and --save-db-password so it will successfully publish the workbook to production.

                   

                  Please check it and tell.