Your SlideShare is downloading. ×
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
How to create a local copy of a wordpress site
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

How to create a local copy of a wordpress site

405

Published on

This article explains how you set up a copy of a WordPress site on your computer. This can be very useful if you need to find out what will happen if you do an upgrade, for testing out and playing …

This article explains how you set up a copy of a WordPress site on your computer. This can be very useful if you need to find out what will happen if you do an upgrade, for testing out and playing with plug ins, and for
developing WordPress themes.

Published in: Internet, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
405
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 1/12 Mark Kirby – Mobile Developer home about speaking How to create a local copy of a wordpress site Monday May 12th 2008 - 40 Comments This article explains how you set up a copy of a WordPress site on your computer. This can be very useful if you need to find out what will happen if you do an upgrade, for testing out and playing with plug ins, and for developing WordPress themes. This article is aimed at PC owners. I use both PC and Mac, and this time I had to do this task on my PC. The principles can also be applied to a Mac, and I have already written a group of articles for Mac which will be linked to from this article that achieve the same results. We’ll be going through the following steps: Installing PHP, MySQL and Apache on a PC to form the ‘local host’ Copying the WordPress install over from your remote host Copying the database Here we go… Installing PHP, MySQL and Apache Mac users Go to my tutorial on setting up PHP, MySQL and Apache on a Mac. PC users There are many packages available that allow a one click installation of PHP, MySQL and Apache on a PC. I looked at a few and settled for WAMP, as its kept up to date, is relatively lightweight and easy to use. 1. Start by downloading WAMP. 2. Run through the installation, accepting the defaults. 3. You should now see a new icon in your taskbar – that’s WAMP! If you don’t see it, just start the software by clicking on the icon, or locating it in your programs. 4. Start your webserver by left clicking on the icon in the taskbar, and selecting Start All Services. Nothing will happen – the services run behind the scenes. 5. Open a browser and go to http://localhost/, if you see the WampServer homepage then you’re ready to
  • 2. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 2/12 start setting up wordpress. Copying the WordPress install over from your remote host Next you are going to download WordPress from your remote host and set it up as a local site. 1. Using your preferred FTP client (I use the excellent free filezilla) download all the files in and including the folder associated with your WordPress install. If your WordPress is in a folder called ‘wordpress’, you need to download the whole folder. 2. Place the downloaded folder into the WAMP folder www. This is where all files to be run on the webserver need to be placed. This can be found by clicking the WAMP icon and selecting the ‘www’ directory option. Its also in C:/wamp/www 3. Once the downloads are complete, go to http://localhost/the_name_of_your_wordpress_folder, you should see a database error. If you do, its all worked! If you see a server error, its likely to be your .htaccess file – try removing it temporarily. Copying the database Now you need to get all the tables associated with WordPress out of the remote server, and onto the local server. You’ll probably need to use PHP MyAdmin, which most hosts include by default. If this isn’t available and your using a version of WordPress which is later than 2.0.3 you can try the wordpress db backup plugin. 1. Log in to PhpMyAdmin 2. Select the database containing your WordPress tables, note down its name 3. Select the Export Option 4. Select all the tables related to this WordPress installation 5. Ensure you download as SQL, check the Data box, so all data is downloaded – complete and extended inserts. Check the box so you save as file and select no compression (it sometimes goes wrong). Next you need to import this data into phpMyAdmin on your local WAMP server. 1. Start PhpMyAdmin by clicking on the WAMP icon and selecting the option phpMyAdmin 2. On the homepage there is an option called ‘Create New Database’, enter the name of the database from your remote server and click create. 3. Click on your newly created database in the left hand column. 4. Click import and browse to your downloaded file 5. Click ‘go’ and all the data should be imported 6. If you have problems with the size of your datafile, there are other methods – send me a mail, or add a comment and I’ll go into them. At the moment I’m trying to keep this document as simple as I can. Next you need to set up the same username and password on this local database as is used on your remote database. You will have used these to log in to phpMyAdmin on your remote server, they are also in your wp_config file. 1. Go to the homepage of the local phpMyAdmin and select ‘Privileges’ 2. Click the add a new user option
  • 3. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 3/12 3. Under username enter the username from the remote host, under host select localhost, under password and re-type enter the password from the remote host. Under privileges check all. Click go. A note on user permissions – I had some issues with the host type – basically, in the wp-config file you need to check the DB_HOST entry. If the host is ‘localhost’ the user in the local mySQL should be set to host – localhost. If the host is ’127.0.0.1′ the user should be set to host – any. Finally, you need to change a couple of fields inside the wordpress database to ensure the correct web address is used. 1. Go to the local phpMyAdmin 2. Select the database containing wordpress 3. Select the table wp_options 4. Select browse 5. Locate the option ‘siteurl’ and edit it so the option_value becomes http://localhost/local_folder_name 6. Locate the option ‘home’ and edit it so the option_value becomes http://localhost/local_folder_name (this might be on the second page of database fields). And you should now be done check http://localhost/local_folder_name. Whats Next Keep an eye out for many more WordPress tutorials over the coming weeks. I’m currently freelancing and am working on a bunch of WordPress sites for various people, as well as working on some open source themes, premium themes and plug-ins. Email me if you need any assistance – kirby [dot] mark [at] gmail [dot] com. Tweet 6Like 38 Comments Mark Kirby Login Sort by Best Share Join the discussion… • Reply • Beri • 3 years ago Great guideline, many thanks!! I did have a problem though. The homepage was showing correctly on localhost, but clicking on any post or page resulted in an 'cannot find url' error. I finally found out how to resolve it: Go to http://localhost/portal/wp-admin/options-permalink.php and change the setting to default. 4 Lee • 10 months ago Hi - I did all this, but for some reasons, when I try to access my site, I get a pop up that says " Favorite Share ›
  • 4. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 4/12 • Reply • Hi - I did all this, but for some reasons, when I try to access my site, I get a pop up that says " 1 • Reply • Ratul • 2 years ago Hi Mark, it works great. But I still have problems updating wordpress version offline, it shows the error: Downloading update from http://wordpress.org/wordpress... Download failed.: Could not open handle for fopen() to http://wordpress.org/wordpress... Installation Failed Do you have any solution how to only download the updated file to an earlier version thats running in localhost? 1 • Reply • Stephen • a month ago Hi, I just wanted to thank you for this excellent tutorial on how to install a development copy of a production Wordpress site. The only problem I had was with displaying subordinate pages, but once I changed the permalink option to "default" that worked fine. Also the SEO plugin did not like being moved to the local site. • Reply • Lee • 10 months ago ooops - here it is • Reply • Walter • a year ago Please help. Under the table wp_options. I cannot find the "home". Please show me where else can I look for. Thanks • Reply • Jasmin Shah • 10 months agoWalter Go to page 2, You'll find it there :-) darren • a year ago Hi Mark, Share › Share › Share › Share › Share › Share ›
  • 5. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 5/12 • Reply • Hi Mark, I followed the steps in the first part but it seems there are problems with the size of the imported database. I am receiving this error: "No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration." What would you suggest? Help would be greatly appreciated! • Reply • Julian • 4 months agodarren I found the info below at this link and it solved this problem for me. - http://forum.wampserver.com/re... Try these different settings in C:wampbinapacheapache2.2.8binphp.ini Find: post_max_size = 8M upload_max_filesize = 2M max_execution_time = 30 max_input_time = 60 memory_limit = 8M Change to: post_max_size = 750M upload_max_filesize = 750M max_execution_time = 5000 max_input_time = 5000 memory_limit = 1000M Then restart wamp to take effect Have fun, • Reply • Veeps • a year ago I'm having a problem that I think is password related, though I could be wrong. I got as far as seeing an "Error establishing database connection" message. If the password is encrypted (in the wp_config file), say as "xyz123*", but I know that password is "passwordx" - which do I use in phpMyAdmin under privileges? Encrypted or actual password? Thanks in advance. • Reply • Josh H • 3 months agoVeeps Hi Veeps did you ever get past that error? I have the same error. Ive searched high and low and I cant get past it. jared • 2 years ago Share › Share › Share › Share ›
  • 6. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 6/12 • Reply • jared • 2 years ago fyi if your db is too large then you can create an .htaccess file in the /phpmyadmin directory to override settings: 1.in /phpmyadmin directory, create an .htaccess file. 2. type the following in the newly-created .htaccess file: php_value post_max_size 21M php_value upload_max_filesize 20M and then change the 21M/20M to whatever you need. make sure the post_max_size is as big or bigger than the upload_max_filesize. thanks for the tutorial! • Reply • Jose • 2 years ago Developing in a test environment is alyaws the best way. You should never run untested code in production. I actually run a QA site as well on a shared host service so I can test deployments and ensure that it all works on a shared host. WP adds some extra twists when you deploy, like having to change all the URL's in the database. MAMP is unnecessary. It looks easy at first, but installs thing in odd ways. The Mac comes with PHP and Apache already installed, all you need to do is install MySQL and you are ready to go. If all you ever use is PHP, MAMP may be good enough, just don't try to install Python on it. I tried, after 4 hours of unproductive messing around in Unix mode I gave up, uninstalled MAMP and went with the standard Mac services. • Reply • andonisr • 2 months agoJose Hey there...when you say "The Mac comes with PHP and Apache already installed", you mean....?? Where is it installed...how do you access it ? I went through hell to try and configure MAMP on my mac, and after countless hours of experimentation with local install of wp I finally got it working. Now I'm used to it and can play around with it, (mostly using phpmyadmin sections of it..! However, it would be good if you can tell me where is installed and does that mean I now have it installed twice...? Thank you.. • Reply • David • 2 years ago I cannot begin to tell you how helpful this walk through has been. Thank you *so* much for doing this. • Reply • Matt • 2 years ago This saved me a lot of trouble. Thanks very much! Share › Share › Share › Share › Share ›
  • 7. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 7/12 • Reply • • Reply • Etienne Sky • 2 years ago Thanks Mark, this is straight forward and it succeeded in bringing my wordpress site up locally, at least the content. Unfortunately I don't get the theme to load correctly. I do have a copy in the wordpress/wb_content/themes folder but it does not seem to get picked up. Would you know where the theme is selected and what I might be missing ? thanks • Reply • Winwood • 2 years ago Helped me get my localhost copy up and running after a f]very frustrating few hours. Thanks :) • Reply • Fabrice • 2 years ago Thank you so much for this tutorial. Great great stuff! • Reply • Ramon • 3 years ago Hi! I have followed all the steps and the main page loads at http://localhost. However, when I click on any post or page, all I get are "Not found" errors. I have the Permalinks plugin by John Bloch installed and this is what is causing the problem. I changed the Permalink settings to default and now I can browse. However, this is not satisfactory since I do need to use the Permalinks once I'm done working on http://localhost and implement the changes to the live site. Can you or anyone here point me to the right direction on how to make permalinks work on http://localhost? • Reply • Damian Saunders • 3 years ago Hi Mark, Thanks so much, I'd been frustrated with this for a while now and other tutorials don't cover the php Admin steps like you did. Still have a couple of glitches with images using fully qualified URLs etc but there's enough to develop and test. Cheers Damian http://www.damiansaunders.net Share › Share › Share › Share › Share › Share ›
  • 8. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 8/12 • Reply • darkhoro • 3 years ago OHH MAANNN thanks a lot, you helped me a lot ! P.S : for people who use easyphp, put http://127.0.0.1:8888/folder_name in siteurl and home. • Reply • Takis Vakatasis • 3 years ago hello Mark thank you so much for this detailed step by step guide.....i follow your steps and finally i made my wordpress theme working locally (my site is: www.judo.com.gr) Best Regards Takis • Reply • sara • 3 years ago Excellent write-up. I have problems when trying to import my database as the file is too big. How can I get around this issue? Many thanks • Reply • milesj • 4 years ago Seemed so simple, however, when I followed all the steps and went to URL localhost:8888/wordpress (I'm running MAMP), the browser window is just blank. Similarly if I go to wp-login.php and login the screen browser remains blank. • Reply • Ryan Erwin • 4 years ago Some people would prefer not update the database content every time they copy the database from Live back to their local system for development. The WordPress Developer Site has some documentation on patching the wp- includes/functions.php file to avoid any SQL changes when reloading the database. Running a Development Copy of WordPress at codex.developer.com. --- Ryan Erwin Shanghai, China Warren • 4 years ago Thanks Mark! Been looking everywhere and this is the first place mentioning the changes for the siteurl and Share › Share › Share › Share › Share ›
  • 9. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 9/12 • Reply • Been looking everywhere and this is the first place mentioning the changes for the siteurl and home. And that did it! • Reply • Michael Soriano • 4 years ago thank you for this. very clear and easy to follow. • Reply • Marcela • 4 years ago Thank you so much for your tutorial. I was able to set up everything with no problems. I still have some glitches to solve but at least I now have a local copy of my site to play around with. This was great help • Reply • Lynn • 5 years ago Kudos to you, Mark! This is the best explanation (and I took a good look at several) and the only trouble I had was just discovering (thanks to the Demers Designs comment) that I needed to set the permalinks to the default. Brilliant! Now I can demo a blog for an organization that won't have an internet connection for our meeting. • Reply • eggplant64 • 5 years ago Amazing! I've been having such a headache with this and then came across this page. Completely resolved all the issues I was having. Thanks you! • Reply • Dave • 5 years ago Thanks for the complete and easy to follow guide, now I have a working localhost and time to modify my templates. Thanks for this great guide! Keep it up :) • Reply • Demers Designs • 5 years ago Great write up. I would like to add one more step that may or may not be necessary. If you are using a custom permalink structure, your links to individual posts and categories may not work when you bring your site to a local server. I have found that if you switch the permalinks back to default, save, and then go back to your custom settings, it should work fine. I assume it is something about the .htaccess file not copying from the live server. Hope this helps someone... John • 5 years ago A note on user permissions - I had some issues with the host type - basically, in the wp-config file you need to check the DB_HOST entry. If the host is ‘localhost’ the user in the local mySQL should be set to host - localhost. If the host is ‘127.0.0.1? the user should be set to host - any. Share › Share › Share › Share › Share › Share › Share ›
  • 10. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 10/12 Using mobile apps for a better trip 2 comments • 5 years ago kirby.mark — Many thanks - I'll defintely check that one out. Whale watching in the islands around … Weekly links – Knol, e-books, subversion and rockstars! 1 comment • 6 years ago Ben Hunt — Hi Mark. Thanks for mentioning "Save the Pixel". Web marketing guru Howie Jacobson … The Oscars Project 1 comment • 3 years ago Kevin — Nice project :D But I guess It would be quite boring for you to watch a lot of black and white … Barcamp summer! 1 comment • 6 years ago ?tef — We should start a BarCamp Romania so you could do the same :) ALSO ON MARK KIRBY • Reply • should be set to host - localhost. If the host is ‘127.0.0.1? the user should be set to host - any. Sir, could you explain what the above text means? • Reply • Browser Media • 6 years ago Just wanted to say thank you for a superb summary of this process. I am just about to update our site (built on wordpress but not touched for a couple of years and long overdue an overhaul) and wanted to set up a local environment. Very useful article and much appreciated! • Reply • chris • 6 years ago so frustrated...i've changed my 'siteurl' and 'home'; however, when i navigate to my site on localhost i get a 404 not found error... the odd thing is it points to the .com address of the live site, but the folder name on localhost...obviously, i've done something wrong...but i can't fathom what... any ideas? • Reply • liam • 6 years ago Nice one man, think I might give this a try. Nice work! • Reply • inspirationbit • 6 years ago Thanks so much for this post, Mark. I didn't know about the last part with the changes for the siteurl and home, and these are so important. WHAT'S THIS? Share › Share › Share › Share › Share ›
  • 11. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 11/12 Subscribe Add Disqus to your site Other places to find me My C.V. (LinkedIn) My Facebook profile (add me if you know me) My bookmarks (del.icio.us) Follow me on Twitter My music (Last.fm) Hatch – my company My Github I support Copyright © 2007 - 2014 Mark Kirby. All rights reserved.
  • 12. 4/15/2014 How to create a local copyof a wordpress site http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/ 12/12

×