Php – How to safely port the wordpress blog to localhost

apachepermalinksPHPWordpress

I'm trying to make local development copies for my wordpress blog. I tried first to install wordpress locally (on XAMPP for Windows), install the plugins then import the live data (from a DB backup). The problem is whenever I import the live data I start getting all sorts of errors, even after I change the blog's URL through the database.

Also, the redirection rules I have on my server don't seem to work locally (whether set by wordpress or some of its plugins).

So is there a safe way to just grab the whole thing and make it work locally exactly like the server?

Your help is much appreciated 🙂

Best Answer

  1. get a full backup of all the files in your online wordpress installation
  2. get a complete backup of the database in use
  3. with any text editing software, process the SQL file of the database backup and change every occurrence of http://old.site with http://localhost
  4. extract the files to your document root
  5. edit wp-config.php to tweak database host/user/pass
  6. import the modified SQL backup
  7. login into admin panel, go to Options->Permalink and save to update permalinks

No need to install anything, just grab what you have online. On windows you might have to rename .htaccess

Related Topic