The underlying repository table structure can change with every release in order to meet the needs of new Tableau Server features or changes, I'd hesitate to update this query just to have it break again in the next version.
I think the best bet will be to move to using the REST API - which returns XML of the data sources on a Tableau Server site by running the Query Data Source method:
You could write a snippet of code to pull down the list of Sites for your Tableau Server, and then iterate over the Sites and pull down all your data sources - and it wouldn't break with upgrades since the REST API is maintained for external use.
I expected as much, I was resistant to give up the old process since I put so much time into it....
Perhaps you can also assist with a Q on my replacement process. I am testing the Tableau API in Powershell in order to perform the datasource/workbook extraction to the file system, then I can hand it over to my previous process for parsing the XML.
This is a partial snippet of my solution. I have removed the details of initial connection for brevity, but it works. The output file is generated, but can't be opened by Tableau Desktop, or a zip file utility. So obviously I have something wrong. Can you verify I am shopping in the right place to get the content XML by going to ...datasources.ChildNodes? Using the interaction Powershell IDE, it seemed to be the only option.
$dslist = Invoke-RestMethod -Uri $server/api/$api/sites/$siteID/datasources -Headers $headers -Method Get
Foreach ($datasource in $dslist.tsResponse.datasources.ChildNodes)
$datasourceID = $datasource.id
$datasourcefnm = $datasource.contentUrl.ToString()
$result = Invoke-RestMethod -Uri $server/api/$api/sites/$siteID/datasources/$datasourceID/content -Headers $headers -Method Get | Out-File "C:\mytest\$datasourcefnm.tdsx"
Ah, I think I see the issues. The Query Data Sources method returns an XML list of the datasources on a Site, rather than returning a collection of the datasources themselves, so it's not possible to iterate through the returned package and output to .tdsx files.
The return package from Query Data Sources is the XML itself. Does that help?
Hi Gary. I vaguely recall running into an issue a while ago, maybe after we upgraded to Tableau Server 10.x, and I think I had to do adjust the join to this:
ON repository_data.tracking_id = COALESCE(data_id,reduced_data_id)
Attached is the full sql from our prod function, let me know if it helps. Granted, this isn't officially supported by Tableau, so every upgrade we do, we need to verify that it still works.
repo.txt.zip 432 bytes
Jeff's right on the money. The change happened from version 10.2 to version 10.3.
Thanks Jeff (and all). Being a general data miner, I haven't delved deeply into the postgres tables behind Tableau. Your tip seems to be working in my testing, and is much appreciated.
I plan to flesh out the Restful API approach when time allows, and replace the not-supported query approach with that. Of course, "when time allows" frequently turns into "when the current process breaks".
Since you're still on a older version of Tableau Server there is an undocumented tabadmin command that you might find useful:
It creates a nice html file called data_dictionary.html in the bin folder. I don't remember what version I found it in, 10.4?, but it made transition versions a bit easier.