2 Replies Latest reply on Jun 21, 2016 5:31 AM by Babcock

    Tableau has just posted a C# Server REST API sample on GitHub, TabMigrate

    Ivo SalmreTableau

      Over that last months’ we’ve had requests for an end-to-end C# REST API sample. We also hear from customers there’s a need for a tool to help move content between Tableau Servers and sites within servers. To kill two birds with one stone we’ve written and just released the code for an application we call "TabMigrate". TabMigrate is a lightweight tool for moving Tableau content between multiple Tableau Server environments, such as test and production Tableau Servers or sites. It can also be used to provision sites with Workbooks and Data Sources from a local file system. Additionally, TabMigrate allows you to produce a CSV file containing an inventory of the site’s users and content, which can be loaded right into Tableau Desktop to analyze your site’s content.

       

       

       

      The project is written in C# and should load into Visual Studio 2013 or newer, including the free Visual Studio Express for Desktop.  Full sources are available on Tableau’s open-source GitHub site, https://github.com/tableau/TabMigrate.

       

       

       

      The source code shows how to:

       

      • Use the Tableau Server REST API  to sign in to your Tableau Server or site and including the session token in all subsequent REST API calls

      • Package and set MIME messages to the REST API for operations such as chunked file uploads

      • Download/Upload both compressed .twbx/.tdsx and text .twb/.tds Workbooks and Data Sources

      • Update a Workbook’s XML to point to data sources on a new server. The sample code shows how to: unzip *.twbx files, (ii) update the Tableau Workbook’s XML so the data sources point to the new server/site, (iii) repackage the transformed workbook back into a compressed *.twbx that can be uploaded to Tableau Server.

      • Associate database credentials with the Workbooks and Datasources you upload

       

      Enjoy!