Home > Just the Video Tutorials, XAMPP > How to Copy Your Online WordPress Blog to XAMPP on Your Local Computer or USB Drive

How to Copy Your Online WordPress Blog to XAMPP on Your Local Computer or USB Drive

April 13th, 2009 Leave a comment Go to comments

No related posts.

  1. June 20th, 2009 at 08:43 | #1

    Super. Hvala za upute.

  2. July 22nd, 2009 at 21:20 | #2

    Thank you so much for this great educational video. I’ve always wondered on how would I do that, and you explained it in a very simple way.
    Thank you

  3. August 31st, 2009 at 13:52 | #3

    I followed your entire process just that I did it in different domain on my host.

    When I completed the import, it comes up with a new WP install dialog and does not show the copy of my main blog.

    When I was modifying the database export file, I saw instances of http://www.askthecomputerdoc.com without the /blog where my main blog resides. I copied my blog to a domain, maverickmoneymakerswinner.com without /blog.

    In any case, it’s not working.

    What do you suggest?

  4. August 31st, 2009 at 13:55 | #4

    I changed the instances of http://www.askthecomputerdoc.com/blog to http://www.maverickmoneymakerswinner.com.

    I did not change http://www.askthecomputerdoc.com at all.Could this be the problem?

  5. August 31st, 2009 at 19:21 | #5

    @David: Looks to me like you have two installs on your live site…one in root and one in /blog. Are you sure you copied the correct one?

  6. September 4th, 2009 at 16:32 | #6

    Thank you! I followed your instructions and I’m almost there. Two things are different in my case:
    1. I’m copying a WordPress MU installation to my local site. I think I have a handle on the MU-specific issues.

    2. My live site lives at the root directory. I’m moving it to a subdirectory off my xampp/htdocs directory. I think this is where my issues may lie…

    I can get to the wp-admin login page (although my theme is obviously not working at this point…). I’m able to input username and password and click the Login button. But at that point it wants to take me to the wp-login page at the root level, so I get an Error 404 page not found.

    Is there something I can tweak in the database SQL file to specify that the local site lives in a subdirectory?

    Thanks!

    Rich

  7. September 4th, 2009 at 17:05 | #7

    @rptrevor: I haven’t been following the wpmu forums recently, but when last I was following those discussions (about a year ago), two things were a no-no in wpmu:

    1. Installing in a subdirectory, and
    2. Installing on localhost

    Seems you are trying to do both of them. You may need to post to the wpmu forums and see if things have changed in the past year.

  8. September 4th, 2009 at 17:44 | #8

    @figaro
    Thanks! Actually I’ve successfully done both (installed on localhost in a subdirectory). I’m new to MU but both of these things have documented how-to’s. It is the copying over of the “live” root-based installation to the localhost subdirectory that is problematic (using your wp-content + edited SQL instructions). I’ll post back when I figure it out…

  9. Rafael
    September 4th, 2009 at 21:30 | #9

    Hi! First of all thanks for this great tutorial!

    I used this tutorial once to move a copy of wordpress blog on my Mac to my remote server since I went ahead and set up a bunch of content locally and didn’t want to re-do all the work. Now I’m trying to make a local copy so I can run a plugin that keeps timing out on my remote server (Regenerate Thumbnails).

    This second time around I’m going backwards (remote to local as the tutorial shows) and I’m having trouble.

    I import my sql dump and it breaks everything. What it find strange is that my sql dump has no references to the remote site URL other than in the “wp_bas_refer” section. 6 total and I replaced those. Also, I kept getting errors on import until I deleted the following from the beginning part:
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;

    Any ideas?

  10. September 5th, 2009 at 08:04 | #10

    @Rafael: I think you may be missing something in your search…the url should be in there at least a couple of times in the options table and I’m pretty sure it will be there a lot in other places as well. Are you sure you are searching on the correct address? Don’t add http or www to your search…just search on your domain name like widgets.com or widgets.com/blog if it’s in a subdirectory. Deleting the comments from the sql file shouldn’t cause a problem.

  11. Rafael
    September 5th, 2009 at 09:50 | #11

    Good, I’m glad deleting those comments doesn’t hurt anything. I am positive that I looked and those were the only references to the domain. Six total in the wp_bas_refer section. Should I try a re-export?

    I have been investigating the fact that when I import the sql dump and I browse wp_options in phpMyAdmin (locally) and I found that the value for site url is “/blog/” and the value for site home is “/blog”.

    I’ve changed those to “http://localhost:8888″ as well as “http://localhost:8888/blog” and that doesn’t fix my problem.

    What I find interesting is that I can go back, drop my imported dump, replace my wp_contents folder with the original one, and I can get WordPress to show me the install screens again.

    So something’s wrong with the dump/import I guess? I also noticed all the references to posts, pages, plugins, etc begin with “blog/”. Does that sound correct?

  12. Rafael
    September 5th, 2009 at 16:25 | #12

    So close yet so far away.

    I get a blank page when loading localhost:8888 or localhost:8888/blog or localhost:8888/blog/wp-login.php

    However, if load localhost:8888/blog/wpadmin/install.php, I get a message from WordPress saying:
    ——————-
    Already Installed

    You appear to have already installed WordPress. To reinstall please clear your old database tables first.
    ——————

    So WP is still installed. It’s just a database problem. Argh! On top of this I can still simply replace the clean wp-content folder, and import a clean sql dump that I created today from the local clean copy of WP, and everything goes back to normal. Just a fresh WP install.

    There has to be one teeny tiny detail that I am overlooking.

  13. Rafael
    September 5th, 2009 at 19:41 | #13

    Well, Some progress. While at the normal state of a fresh WP install, I exported the wp_options table and re-imported it after importing the sql dump.

    This makes it so that I can see everything pretty much as I see it on the remote (online) server.

    With one huge exception. All the image links are broken. Thumbnails show the broken image link question mark icon. Everywhere.

    Also, all my plugins were inactive and some are giving me trouble when re-activating,

    The main reason I want to do this is so I can run Regenerate Thumbnails and re-crop all the thumbnails from the top left.

    How can I restore the links to the images?

  14. Rafael
    September 5th, 2009 at 22:17 | #14

    I’ve made progress. I had to to a find/replace in the sql dump in order to remove “blog/”. That fixed the image links.

    Then re-import the sql dump, drop wp_options, and re-import the clean wp_options.

    A lot of the plugins are wonky and some won’t activate (one from Yahoo–probably because it’s on a local environment.)

    I hat to get rid of wp-cache. If present at all, a line of code was appearing at the very top of the WP control panel and the blog pages and posts and everywhere on the local site.

    And, Renenerate plugins ran only once and ti did the opposite of what I wanted.

    I just saw the import feature. I think I’m going to go with a fresh install again and import the XML file that I can export from the remote site. That may be much more stable.

    Does anyone know how to edit media.php so that it generates thumbnails from the top left or just the top?

  15. Rafael
    September 6th, 2009 at 10:47 | #15

    Well, I accomplished what I wanted. I started with a fresh WP install and I imported all my posts and pages with the XML file exported remotely. Attachments downloaded during the process.

    All image links in pages and posts had an extra “blog/” in the path and I fixed some. I installed some plugins manually.

    But those weren’t my goal.

    I did find the code to edit media.php so that thumbnails are generated from the top and left. And I ran Regenerate Thumbnails again and made sure that all my thumbnails were cropped correctly. They were.

    Then I uploaded my “uploads” folder via ftp and replaced the old one (have a local copy just in case).

    Everything turned out well I guess. My thumbnails look good.

    I’m still going to follow up on how to easily copy my remote blog/site into my local machine or thumbdrive. I really like the idea of having it portable since I have my portfolio on there.

    I did another sql dump after changing the “siteurl” and “home” in “wp_options” to have the value of “http://www.site.com/blog”. It didn’t break the remote site, but the sql dump still only has like 6 references to the full site URL still in the wp_bas_refer_section. Any ideas?

  16. September 6th, 2009 at 11:43 | #16

    @Rafael: The wp_bas_refer_section — is that a table? If so, it’s not a standard WP table.

  17. Rafael
    September 6th, 2009 at 12:44 | #17

    Yes, its a table. I can see it in phpMyAdmin remotely. It’s not available as part of the standard WP install like you said. It does show locally if I drop all the tables and import the sql dump.

  18. September 6th, 2009 at 12:54 | #18

    @Rafael: If you want to post the sql dump somewhere and send me a message (use the contact form on this site) telling me where to download it, I’ll take a look…your url has got to be in there…at least in the options table.

  19. Rafael
    September 6th, 2009 at 15:48 | #19

    OK =]. I can export a fresh dump and upload it somewhere you can grab. I’ll send you a message letting you know where to download it.

  20. October 1st, 2009 at 22:43 | #20

    I mentioned above that it didn’t work but from your excellent video I got the idea of how to do it. I backed up the posts separately and loaded them separately and it’s working beautifully.

    Thanks

  21. Anoop
    October 14th, 2009 at 04:00 | #21

    First of all congrats to the creator of this very well explained video.

    Hi David,

    Any idea how that happened at the first place bcoz the same is happening to me also. I’m being directed to installation page at the end.

    Thanks,
    Anoop

  22. ink
    October 26th, 2009 at 14:47 | #22

    Thankyou so much! I can’t even express how much I appreciate this video. I’ve been trying to get this working for far too long. Your guide is the only one which got me through. Thankyou! I’ll send you a donation to buy you a drink or two tomorrow! Thanks!!

  23. October 27th, 2009 at 14:28 | #23

    great tutorials, Its seems that I ran into some problems tho. after following all the instructions step by step I get:

    Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at C:\www\htdocs\wordpress\wp-content\plugins\calendar\calendar.php:5421) in C:\www\htdocs\wordpress\wp-content\plugins\formbuilder\captcha\CaptchaSecurityImages.php on line 51

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at C:\www\htdocs\wordpress\wp-content\plugins\calendar\calendar.php:5421) in C:\www\htdocs\wordpress\wp-content\plugins\formbuilder\captcha\CaptchaSecurityImages.php on line 51

    Warning: Cannot modify header information – headers already sent by (output started at C:\www\htdocs\wordpress\wp-content\plugins\calendar\calendar.php:5421) in C:\www\htdocs\wordpress\wp-content\plugins\sidebar-login\sidebar-login.php on line 603

    Please help.

  24. October 27th, 2009 at 14:39 | #24

    @Anoop
    I followed all the steps that were recommended which copied all the plugins and themes but didn’t get my posts.

    I did a separate backup and restore of the posts after going in as a new installation and then everything was basically there.

    I don’t know why it didn’t work without that.

  25. October 27th, 2009 at 17:50 | #25

    @Allan: You may need to disable the formbuilder and sidebar-login plugins and see if you have better luck.

  26. November 18th, 2009 at 08:36 | #26

    Thank you very much for this tutorial. I’ve been trying to figure out how to do this since two days and while I found a lot of information, this tutorial finally helped me to get my blog running on my computer. Now I can go nuts testing :-)

  27. November 18th, 2009 at 10:38 | #27

    @Dani: You’re welcome…glad it helped.

  28. April 29th, 2010 at 18:24 | #28

    Thanks for this video! I got through all the steps and it was working fine..and then all of a sudden I get this message:

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

    It was working fine. I went to the login page, logged in, scrolled down to the Settings Menu (everything still fine), then clicked on Permalinks (because my permalink structure was messed up) and I noticed that the Admin Panel had lost some of its style effects. I was like “That’s weird”, so then I opened up a seperate tab and tried to get to my site..and I got that message. Now I can’t get into anything! What did I do? How can I fix it?

    Also, my CSS sheet is not working for the site (from what I could see before I got this error).

    Anyways, thanks a bunch for this video! I hope you can help me out!

    Thomas

  29. April 29th, 2010 at 19:11 | #29

    @Thomas: Looks like your site is up now…hopefully you got it sorted.

  30. April 29th, 2010 at 20:49 | #30

    My live site is fine (I didn’t mess with that server or anything). It’s my local server that is giving me issues. When I go to access my site via localhost, that’s the error message that I get. I can get to the xampp menu fine, but I can’t get to my actual blog.

    Any suggestions on what may have happened?

  31. April 29th, 2010 at 21:23 | #31

    Ok, it is the .htaccess file that is causing all the issues.

    When I checked in the error log for Apache, it seems that the ReWrite Engine function is what is screwing everything up. I took all the stuff out of the .htaccess file and it worked fine, but as soon as I tried to get into the Permalink structure, WordPress tried a ReWrite again and everything shut down. How can I fix this?

  32. Dave
    May 7th, 2010 at 15:11 | #32

    I’m having the same issue as Thomas with the permalinks. The .htaccess file isn’t being read properly it seems. Any ideas?

    @Thomas

  33. May 11th, 2010 at 16:33 | #33

    This was a fantastic tutorial. I followed it to the letter, and everything went well until the very, very end. After I imported my SQL I went back to the localhost site, and now I get an error and redirected to a search page. Any suggestions?

  34. May 11th, 2010 at 19:10 | #34

    @Heather: It sounds like you may not have changed the url properly when editing the sql dump. Watch that part of the video again and make sure you are changing the online url to what your localhost url is. For example, if your online url is…

    http://www.sideofsneakers.com

    and you installed wordpress in a directory in XAMPP called wordpress, then your XAMPP url would be:

    http://localhost/xampp/wordpress

    so you would need to do a search on http://www.sideofsneakers.com and replace it with with http://localhost/xampp/wordpress

    Then I would do another search on just sideofsneakers.com and replace with localhost/xampp/wordpress

  35. May 11th, 2010 at 19:12 | #35

    @Dave
    I don’t use the .htaccess in XAMPP

  36. Tracy
    July 14th, 2010 at 10:41 | #36

    Thanks for the great tutorial! Everything worked great for me, until I imported my blog’s sql file. The when I look for the blog at localhost, I’m getting a message that says “Apologies, but the page you requested could not be found. Perhaps searching will help.” I can then click on a link that takes me to my blog online.

    I tried deactivating most of the plug-ins and then reimporting (after dropping the tables first), but this didn’t help.

  37. Tracy
    July 14th, 2010 at 10:50 | #37

    @Tracy
    Just a note: I was actually having this same problem when I tried to copy my blog online.

  38. August 21st, 2010 at 16:13 | #38

    I’m hoping for some advice please – been trying to create a development copy of my remote site for a week without success and after numerous attempts.

    Everything seems to be ok – all my wp content folder is there; including theme, plugins etc and the local folder and remote folder are the same size.

    There are no database errors.

    But none of the pages created on the remote site or the navigation for those pages is there!

    I’m sure it will be something simple – but it’s proved to be too challenging for me – can anyone help please?

    Regards,

    Harry

  39. October 26th, 2010 at 21:27 | #39

    I got through everything, then after uploading the MySQL it says not found. I see a page with my theme and blank widgets, just no info. Any ideas?

  40. October 27th, 2010 at 07:36 | #40

    @Amy: Not really enough info for detailed directions, but if you can log into the site, then change the theme to the default and update the permalinks.

  41. October 27th, 2010 at 12:24 | #41

    I think part of the problem is that I am using Worpdress as a CMS. When I went in to replace the URL’s I still see some there, for instance http://hungryhappyhealthy.com/wp-content/… I replaced hungryhappyhealthy.com/blog with localhost/xampp/wordpress, so my thought is that is only replacing the blog itself and not the static home page settings. Any thoughts on correcting that issue?

    It appears that there is not an issue with the Child Theme, though. All of the widget areas, colors, etc, come up. But, I did not change permalinks prior to import, so I will do that as well.

  42. Robert
    November 7th, 2010 at 13:52 | #42

    Many thanks for this.

  43. Robert
    November 7th, 2010 at 20:35 | #43

    @Robert
    actually… I ran into the same issue as Harry. =(

  44. April 24th, 2011 at 10:27 | #44

    Just wanted you to know this video is still helping people. Thanks so much! I will be referring to your site a lot now, too.

  45. September 6th, 2011 at 15:39 | #45

    thanks a lot..
    this worked for me..:)
    will i am using WAMP.. what kinda problems can i expect.
    thanks in advance

  46. Laurence
    February 9th, 2012 at 04:48 | #46

    This process works fine – in fact I wish I had done this first before stuffing around with other plugins and migration solutions.

    Issues I had

    a) my theme wasn’t activated when I loaded my copied site (all content was successfully copied) – no problem just re-selected it under Appearance (using Weaver)

    b) My header logo not displayed – no problem just re-selected it under Appearance

    c) Plugins not activated – this actually gave an error on the front page upon loading – because I use an index plugin- still no real issue, just reactived all the plugins

    d) Couldn’t add a new plugin – I wanted to use my localhost site as a test for new functionality – no real issue – opened wp-config and commented out the line
    define(‘WP_TEMP_DIR’ ……
    and all was Ok

    Somewhere out there is probably a plugin that actually migrates properly but really the process demonstrated above is very easy and you actually feel you have control so you know what is going on and how things are progressing.

    I’m very happy I found the solution on this site

    Highly recommend

  47. February 9th, 2012 at 14:02 | #47

    Thanks for the info Laurence…glad you found this helpful.

  48. March 15th, 2012 at 11:17 | #48

    I’ve been looking for literally months for a good tutorial on how to go from a live wordpress blog into a test environment. Thank you!

  49. Ooi
    May 16th, 2012 at 16:46 | #49

    Hi, i follow all the instruction.

    But after i import the sql ( after made changes ), its direct me to :

    http://localhost/xampp/wordpress/wp-admin/install.php

    Can you please guide me to settle this problem?

    Thanks

  50. May 17th, 2012 at 09:53 | #50

    Watch the videos again…you missed a step somewhere.

  1. December 14th, 2009 at 12:29 | #1
  2. January 4th, 2010 at 06:25 | #2