I have a web.config file that has the connectionstring & appsettings in a debug file like so:
<connectionStrings configSource="config\connectionStrings-debug.config" />
<appSettings configSource="config\AppSettings-debug.config" />
but when I go to deploy, I have manually change this to the prod value:
<connectionStrings configSource="config\connectionStrings.config" />
<appSettings configSource="config\AppSettings.config" />
I was looking at transformations, but I don't know how I'd use it in this situation as every example was trying to alter a value not a path to a file.
You should be able to achieve what you want with a simple transform. e.g.:
<connectionStrings xdt:Transform="SetAttributes" configSource="/new/path" />
The same applies for appSettings.