404 error when wordpress database exported from server and imported to local server

I have a wordpress site and I have exported database from server and imported it in local server.I have changed site url and home url in wp-options and resave permalink. Anything more I want change? Whenever I tried to load the site it will go to sever. In general settings, site Address(URL) is disabled. In permalink all are server urls. How can I access my site locally. I have imported my files also from server. Any problem with files?

Related posts

1 comment

  1. You need to do a Find & Replace on your SQL export to update all URLs in the database.

    For example, all references of “http://www.live-site.com” need to be replaced with “http://localhost/test-site“.

    You can do the Find & Replace using any text editor (TextEdit, Sublime Text, etc) and it will find most URLs, but it might not get everything due to data serialisation.

    Recommended in the WordPress Codex:

    If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:

    1. Use the Better Search Replace or Velvet Blues Update URLs plugins if you can access your Dashboard.
    2. Use WP-CLI’s search-replace if your hosting provider (or you) have installed WP-CLI.

    Another tool you can use is Database Search And Replace Script which will also replace any URLs stored in serialised arrays in the database.

Comments are closed.