We have 100+ datasources in our onprem tableau server, We need the list of datasources connected in this server, Kindly help to get that list by exporting over GUI or Linux command line.
#Tableau Server
Hi Silambarasu - for ~100 published data sources you have three solid options; pick by how you want to consume the output. (Quick note: 'data sources connected in this server' usually means the published data sources - if you actually need the underlying database connections behind them, see option 3.)
1) REST API - best for a pure Linux command line, no extra install. Two curl calls:
- Sign in: POST to /api/3.24/auth/signin with a Personal Access Token; grab the auth token and site id from the response.
- List: GET /api/3.24/sites/{site-id}/datasources with pageSize=1000 and header X-Tableau-Auth: {token}. Send Accept: application/json and pipe through jq to pull name/project/owner into a CSV. Your 100 fit in a single page (pageSize max is 1000), so no pagination loop needed. This is the 'Query Data Sources' endpoint.
2) tableauserverclient (Python) - easiest if you want the CSV written for you and would rather not hand-roll curl. A few lines: sign in with the PAT, call server.datasources.get() to get the list, then write name/project/owner to a file. It handles auth and paging, and runs fine headless on the Linux box. (Plain tabcmd has no 'list data sources' command, so REST or TSC is the way for an inventory.)
3) Repository (Postgres) - if you want everything in one SQL query: owner, project, size, last refresh, even the underlying connection. Tableau Server ships a read-only repository user:
- Enable it once: tsm data-access repository-access enable (sets up the 'readonly' user; you set its password).
- Then connect with psql to host localhost, port 8060, user readonly, database workgroup, and query the datasources table (join projects and system_users for readable names). Export the result set straight to a CSV. Most complete view, pure SQL.
4) If you also need data sources embedded inside workbooks (not just published ones), the Metadata API is cleanest: POST to /api/metadata/graphql and ask for publishedDatasources (name, projectName). Returns JSON, jq to CSV.
For a one-time pull I'd start with option 1 or 2; for a repeatable audit with rich metadata, option 3.
If this helps, please mark it as the Best Answer so it helps the next person - thanks :)