tableau / TabMigrate

A lightweight tool for moving Tableau content between multiple Tableau Server environments
MIT License
119 stars 59 forks source link

TabMigrate

Community Supported

What is 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. TabMigrate also allows you to produce a CSV file containing an inventory of the site’s users and content; useful for analysis in Tableau.

Often there is a need to copy a set of content from one Tableau Server environment into another. Sometimes this need is across different Tableau Servers (or Tableau Online), other times there is a need to copy some content from one site in a server into another site. Today, this can be complex and require manual steps. For example, if a published workbook utilizes published Data Sources it is often impossible without significant manual steps to move the data sources and content form one Tableau Server to another.

By comparison, Tableau Server’s tabAdmin tool offers a full “site import and export” for copying and replacing an entire site. This is powerful but heavy-weight, replacing the entire site, its users, its schedules, etc. This tool offers a lightweight approach built on top of Tableau Server’s REST APIs.

Video Introduction

There's a short video introduction available on Tableau's YouTube channel. You can watch the full video or just jump to specific sections:

Versions of Tableau Server

TabMigrate was written and tested with version 10.2 of Tableau Server.

Getting started with TabMigrate (for non-developers)

You do not need to download and compile the source code to use TabMigrate. Those interested in simply running the application can download and unzip the setup from https://github.com/tableau/TabMigrate/releases (hint: the latest release is in v1.02_2015_11_13_TabRESTMigrate.zip -> download, unzip, and rock on). Running setup.exe will install the TabMigrate application on your Windows machine.

Application: The application can be run in either interactive (UI) or command line mode. When running in interactive mode the application will also show you the command line for performing all of the actions, making it easy to automate. The application UI offers three top level options:

  1. Generate an inventory of your site: This downloads information about your site into a *.csv file that can easily be loaded into Tableau Desktop or Excel.
  2. Export content from your site: You can either export your entire site (all the Workbooks and Data Sources), or choose an individual Project whose contents you want to export. Export will create file system directories for “workbooks” and “datasources” and download your sites content into subdirectories named after each Tableau Server site you export.
  3. Import content from your file system: You can bulk upload workbooks and datasources from your local file system into a Tableau Server site that you choose. This expects the same file system directory site export; file system directories are named for the Tableau Server projects that they will be published into. NOTE: You can also specify database IDs and Passwords to use when publishing your Workbooks and Data Sources. Workbooks with live database connections REQUIRE passwords to be included during publish. These are specified by listing the database credentials in an XML (text) file. Example:
<!-- Example file that shows how credentials can be declared. This file can be used as part of site import to supply needed workbook and datasource credentials-->
<xml>
     <credential 
          contentType="workbook" 
          contentProjectName="Test Site Import" 
          contentName="test.twbx" 
          dbUser="SimpleUser" 
          dbPassword="q.123456" 
          credentialIsEmbedded="false"> 
     </credential>
     <credential 
          contentType="datasource" 
          contentProjectName="Test Site Import" 
          contentName="test2.tds" 
          dbUser="SimpleUser3" 
          dbPassword="q.12345678"> 
     </credential>
</xml>

Safety tips

The REST APIs used by this application allow you to upload, download, and otherwise modify your site’s content, workbooks, data sources, content tags, etc. So yes, it is certainly possible for you to overwrite existing content on server. A few tips:

Getting started with TabMigrate (for developers)

Source code: The project is written in C# and should load into Visual Studio 2013 or newer, including the free Visual Studio Express for Desktop.

What’s particularly useful in the source code?

The code demonstrates complex aspects of both the REST API and moving content between sites/servers. Someone working with the code will have a great base for calling any Tableau REST APIs from C#. Examples of things that are hard without detailed working code:

The source code also contains example files in a “_SampleFiles” subdirectory.

Is TabMigrate supported?

Community supported. Using it you can accidentally modify or delete your content, just as you can by accidentally do so in the user interface. Despite efforts to write good and useful code there may be bugs that cause unexpected and undesirable behavior. The software is strictly “use at your own risk.”

The good news: This is intended to be a self-service tool. You are free to modify it in any way to meet your needs.