To give you a quick background on what I am working with - I manage 3 copies of our company website; our live site that customers visit, a dev site that is live but not indexed so that our website content team and I can test new things together, and a localhost site where I do all the code changes before I push them to our dev site. Every once in a while, when enough changes have been made and we are ready to make another big change, I refresh the dev site and my local site from our live site by exporting everything (database and all) and importing it on the others.
When I make a code change and am ready to deploy, I simply copy all the template files over to the destination site and overwrite all existing files.
The problem at hand, is that sometimes some of the pages will lose their association with the template file that was build for them and be changed to the default template when I overwrite the existing template files on a code publish. It's super inconsistent with when it happens and which pages it happens to, and I don't update any of the template names or file names, so it can't be that.
Does anyone have any thoughts or experience this with their sites?