We originally had two templates, using the same masterpage.
Since then we have had to split this so we created two new masterpages, one for each template.
As we already had a lot of pages using the original templates, we wrote a query to map the templates to the new masterpages in the database. To do this we found out the TemplateID of each template. Then ran an update to change to the new masterpage for each (In the sf_PageContentBase) table
Similar to this article -
We found that we also had to update the sf_StagedPageContent table.
When we click on a page via the pages module it still appears with the old original template/masterpage. Yet when you click to edit the page, it shows the new updated template/masterpage. Also when publishing (we are using workflow) or previewing the page it uses the original template.
Is there another table or something were missing to be able to do this correctly?