Long story short, I moved a WordPress site (following this guide like I have done before) from a dev folder to the root of the site and it's screwed up the permalinks.
Strangely, it's not all the permalinks though. Half of the pages and posts are using the new structure, ie:
But the other half show 404 pages. However if I try to go to view the page using the old structure, they show up:
This is only under the custom permalink settings of "/%postname%/". If I switch back to default link structure everything works fine! I've tried resetting the permalinks, clearing the .htaccess, disabling/enabling the theme, checked the Site URL and WordPress address in the Settings, I've even gone through the DB to find any references to the old URL structure but nothing seems to work.
Anyone get any ideas? How can I get WordPress to update the link structure for all pages and posts?