A command-line tool for managing and batch-updating data source and workbook connections in Tableau Cloud and Tableau Server. This tool allows you to efficiently update database credentials across multiple data sources and workbooks that share the same connection details.
- π Secure Authentication - Uses Personal Access Tokens (PAT) for Tableau Cloud authentication
- π Comprehensive Coverage - Manages connections from both published data sources AND workbooks
- π Smart Grouping - Automatically groups connections by unique server/port/username combinations
- π Batch Updates - Update multiple connections at once across data sources and workbooks
- π» Interactive Console - User-friendly command-line interface
- π Secure Password Input - Masked password entry for security
- β Validation & Confirmation - Shows what will be updated before making changes
- π Visual Indicators - Clear icons distinguish data source (π) from workbook (π) connections
The tool performs the following operations:
- Authenticates with Tableau Cloud using your Personal Access Token
- Enumerates all data sources and workbooks on your site
- Queries connections from both published data sources and workbook-embedded connections
- Groups connections by unique combinations of server address, port, and username
- Displays a numbered list of unique connections showing which data sources and workbooks use them
- Allows you to select a connection group to update
- Prompts for new connection details (server, port, username, password)
- Updates all data sources and workbooks that use the selected connection in one batch operation
If you have 5 data sources and 10 workbooks all connecting to the same database with the same credentials, instead of updating each one individually (15 updates!), you can update all 15 at once by modifying a single entry in the list.
Real-World Scenario: You need to update the production database password. With this tool, you can:
- See all 15 assets using that connection in one view
- Update the password once
- Have all 15 connections (data sources + workbooks) updated automatically
This tool works with:
- β Tableau Cloud - All sites
- β Tableau Server - Version 2019.4 and later (when PAT authentication was introduced)
- .NET 9.0 SDK or later
- A Tableau Cloud or Tableau Server account with:
- Personal Access Token (PAT)
- Permission to modify data source and workbook connections
- Git (for cloning the repository)
git clone https://github.com/rkrogers/tab-db-migrate.git
cd tab-db-migrateThe application can be built on Windows, macOS, and Linux.
cd tab-db-migrate
dotnet build -c Releasecd tab-db-migrate
dotnet build -c ReleaseTo create a self-contained executable that doesn't require .NET to be installed:
dotnet publish -c Release -r win-x64 --self-containedThe executable will be in: tab-db-migrate/bin/Release/net9.0/win-x64/publish/tab-db-migrate.exe
dotnet publish -c Release -r osx-arm64 --self-containedThe executable will be in: tab-db-migrate/bin/Release/net9.0/osx-arm64/publish/tab-db-migrate
dotnet publish -c Release -r osx-x64 --self-containeddotnet publish -c Release -r linux-x64 --self-containedThe executable will be in: tab-db-migrate/bin/Release/net9.0/linux-x64/publish/tab-db-migrate
Before running the tool, you'll need:
- Tableau Cloud Server URL - Your Tableau Cloud site URL (e.g.,
https://10ay.online.tableau.com) - Personal Access Token (PAT) - Create one in Tableau Cloud:
- Go to your Tableau Cloud account settings
- Navigate to "Personal Access Tokens"
- Click "Create new token"
- Save the token name and secret
- Site Name - The content URL of your site (e.g.,
mysitefromhttps://10ay.online.tableau.com/#/site/mysite)
cd tab-db-migrate
dotnet runThe application will prompt you for:
- Tableau Server URL
- PAT token name
- PAT token secret (hidden input)
- Site name
dotnet run "server-url" "token-name" "token-secret" "site-name"Tableau Cloud Example:
dotnet run "https://10ay.online.tableau.com" "my-pat-token" "abc123xyz789..." "mysite"Tableau Server Example:
dotnet run "https://tableau.mycompany.com" "my-pat-token" "abc123xyz789..." "finance"Tableau Server (Default Site) Example:
dotnet run "https://tableau.mycompany.com" "my-pat-token" "abc123xyz789..." ""If you created a standalone executable:
Windows:
.\tab-db-migrate.exe "server-url" "token-name" "token-secret" "site-name"macOS/Linux:
./tab-db-migrate "server-url" "token-name" "token-secret" "site-name"- Authentication: The tool authenticates with Tableau Cloud
- Enumeration: Queries all data sources and workbooks, displaying unique connection combinations
- Selection: Enter the ID number of the connection you want to modify
- Input: Provide new connection details:
- Server address
- Server port
- Username
- Password (masked input)
- Confirmation: Review the changes and confirm
- Update: The tool updates all matching connections across data sources and workbooks
- Results: See a summary of successful/failed updates
Tableau Data Source Connection Manager
======================================
Authenticating with Tableau Cloud using PAT...
β Authentication successful!
Enumerating data sources and workbooks...
Found 12 data sources on the site.
Found 8 workbooks on the site.
================================================================================
UNIQUE CONNECTIONS (Data Sources + Workbooks)
================================================================================
[1] Server: db.example.com, Port: 5432, Username: admin
Used by 7 connection(s):
Data Sources: 3, Workbooks: 4
π Sales Data (datasource)
π Customer Data (datasource)
π Product Catalog (datasource)
π Sales Dashboard (workbook)
π Customer Analysis (workbook)
π Executive Summary (workbook)
π Regional Report (workbook)
[2] Server: warehouse.example.com, Port: 1521, Username: etl_user
Used by 3 connection(s):
Data Sources: 2, Workbooks: 1
π Data Warehouse (datasource)
π Analytics DB (datasource)
π ETL Monitor (workbook)
[3] Server: 10az.online.tableau.com, Port: 443, Username:
Used by 5 connection(s):
Data Sources: 0, Workbooks: 5
π Admin Insights (workbook)
π User Activity (workbook)
π Content Usage (workbook)
π Performance Metrics (workbook)
π Site Statistics (workbook)
================================================================================
Enter the ID of the connection you want to modify [1-3] (or 'q' to quit): 1
Selected connection group #1
Current: Server=db.example.com, Port=5432, Username=admin
This will update 7 connection(s) (3 data sources, 4 workbooks)
New Server Address: db-new.example.com
New Server Port: 5432
New Username: admin
New Password: ********
Proceed with batch update? (y/n): y
Updating connections...
Updating Sales Data (datasource)... β
Updating Customer Data (datasource)... β
Updating Product Catalog (datasource)... β
Updating Sales Dashboard (workbook)... β
Updating Customer Analysis (workbook)... β
Updating Executive Summary (workbook)... β
Updating Regional Report (workbook)... β
β Batch update complete!
Successfully updated: 7
Signing out...
β Signed out successfully!
The tool manages two types of connections:
Published data sources that are shared across multiple workbooks. These are managed through the Data Sources API.
Connections embedded directly in workbooks (not using published data sources). These are managed through the Workbooks API.
Connections are grouped by their unique combination of:
- Server address
- Server port
- Username
This means a single connection profile might be used by multiple data sources AND workbooks. The tool lets you update all of them at once, regardless of whether they're in published data sources or embedded in workbooks.
Simply provide the appropriate server URL when running the application:
- For Tableau Cloud: Use your pod URL (e.g.,
https://10ay.online.tableau.com) - For Tableau Server: Use your on-premises server URL (e.g.,
https://tableau.mycompany.com)
The default API version is 3.21. To use a different version, edit the apiVersion constant at the top of Program.cs:
const string apiVersion = "3.21"; // Change if neededWhen using with on-premises Tableau Server:
- Ensure your Tableau Server is version 2019.4 or later (required for PAT support)
- Use the base server URL without the
/apipath - For the Default site, use an empty string
""as the site name parameter - For named sites, use the site's content URL (e.g.,
finance, nothttps://.../#/site/finance) - Verify that Personal Access Tokens are enabled on your server (usually enabled by default)
- Never commit credentials to version control
- Use Personal Access Tokens instead of username/password
- Rotate tokens regularly following your security policy
- Limit PAT permissions to only what's necessary
- Store tokens securely using your organization's secrets management solution
- Verify your PAT is valid and not expired
- Ensure the site name is correct
- Check that your account has API access enabled
- Verify your account has permission to view data sources and workbooks
- Check that the site name matches your Tableau Cloud site
- Ensure your account has permission to modify data source and workbook connections
- Verify the new connection details are valid
- Check that the data source/workbook connection supports updates
POST /api/{version}/auth/signin- Authentication with PATPOST /api/{version}/auth/signout- Sign out
GET /api/{version}/sites/{site-id}/datasources- Query data sourcesGET /api/{version}/sites/{site-id}/datasources/{datasource-id}/connections- Query data source connectionsPUT /api/{version}/sites/{site-id}/datasources/{datasource-id}/connections/{connection-id}- Update data source connection
GET /api/{version}/sites/{site-id}/workbooks- Query workbooksGET /api/{version}/sites/{site-id}/workbooks/{workbook-id}/connections- Query workbook connectionsPUT /api/{version}/sites/{site-id}/workbooks/{workbook-id}/connections/{connection-id}- Update workbook connection
tab-db-migrate/
βββ tab-db-migrate/
β βββ Program.cs # Main application and user interface
β βββ TableauAuthenticator.cs # PAT authentication handling
β βββ List.cs # Data source & workbook enumeration and updates
β βββ tab-db-migrate.csproj # Project configuration
βββ tab-db-migrate.sln # Solution file
βββ README.md # This file
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is provided as-is for use with Tableau Cloud and Tableau Server.
For issues or questions:
- Open an issue on GitHub
- Refer to Tableau REST API Documentation