Recently I lost my local WordPress development environment, so I need to get the copy from my server, I still have WordPress source files, so I just need to FTP back my themes folder and export the whole database in SQL file.

After I get the SQL file, I open the SQL file in text editor and replace all the server domain to my local domain, e.g. changing www.stephensaw.me to stephensaw.local. Then run the SQL on my local database to restore it, it works great, can access to stephensaw.local without problem, can access to admin, the site URL in admin also correct.

But,

I can’t access to my pages, all links seems to throwing 404, but I can see and edit the pages in admin page without problem. Beside page, even when I added new post type, those posts throwing 404 as well.

If I called technical support, I’m sure he will say “Have you try turn it off and on again?“. The solution to my problem is quite similar, just have to go to Permalink in admin page and simply click Save button again. Simply solution to a problem that I have yet to find out why.