Briefly, it's easy if your data sources are the same type, trickier if they are different. I can't remember off the top of my head what the nuances are. What type of data source?
Both data sources are Tableau Data Extracts, which I converted from .csv files. Any advice on which part of the .xml I need to edit would be great!
Thinking about this a bit more, I don't think your likely to have a lot of success in pointing a workbook at a different extract file - even if both extracts are generated from CSV files with the same structure. The problem is that the state of the workbook and the extract are very closely coupled and in ways that are not exposed to the user. So for example, if you create calculated fields, those are stored in the workbook with arbitrary internal names and often result in additional fields being stored in the extract. So even if you add the same calculations to two workbooks, the internal names used for those calculated fields will probably be different. That is the source of your cryptic references.
So I think your best bet is to re-point your workbook at the new CSV file and allow Tableau to regenerate the extract. You can even explicitly remove the extract, point at a new CSV file and then generate a new extract.
I often make a copy of the workbook with a new name, remove the extract from that, point at a new CSV and then generate a new extract with a different name. If you don't remove the extract first and just let Tableau regenerate you can end up overwriting your original extract.
That should all work just using the user interface to edit the connection.
Back to your original question, if you do end up directly editing the XML, you basically just need to search for all references to the filename and replace all of them with the new name. If your CSV file is called abc.csv, make sure you look for strings of abc#csv, too.
Thanks very much for the detailed response! I tried copying the workbook to go through the process you described, but when I remove the original extract all of my calculated variables and the worksheets that use them are deleted from my workbook, and they don't get re-generated when I connect to a new Excel file.. they're simply gone.
I've also tried bringing in the Excel file (and the extract version of that Excel file) without deleting the original extract data source, and that generates the corrupted calculated variables. This is the issue that led me to ask about editing the .xml instead.
I'm a bit disheartened here because this workbook took me several weeks to create, and it's now useless because I can't get it to work with new data. If anyone has any other advice please let me know.