How to Backup Your WordPress Blog and Install it Locally Using Xampp
February 14th, 2010 by
If you blog seriously, a vital thing to do is to backup your blog.
The backup is used not only for the obvious reason of holding another copy to restore from when necessary, but for testing purposes as well.
Check out the video below for a step by step tutorial.
To sum up the process:
- Download and install XAMPP.
- Download the latest WordPress.
- Copy the WP-content folder from your live blog (via FTP or File Manager) to your local hard drive.
- Export the mysql databse of your live blog via PHPmyAdmin.
- Navigate to htdocs folder in XAMPP (usually c:/xampp/htdocs/) and create a new folder with your site’s name.
- Copy all files and folders from the wordpress folder you downloaded (except wp-content folder) into the newly created folder in XAMPP.
- Copy the WP-content folder (the one you backed up from your blog) into the newly created folder in XAMPP.
- Go to PHPmyAdmin in XAMPP.
- Create a new database and name it after your live blog.
- Import the mysql db you previously exported.
- Navigate to the db options table in and change the siteurl and home values to match your new local url.
- Open wp-config file (from the new folder you created in XAMPP).
- Change the DB_NAME, DB_USER and DB_PASSWORD fields to match your db definitions.
- Define a new site in DreamWeaver. The path should be the same as the new folder in XAMPP.
- Press CTRL + F and and change “find in” to “Entire Current Local Site”.
- First replace “<? ” with “<?php “.
- Then replace your live site url with the new local url.
- Check you local blog to see that everything works.
- If necessary, install the Search and Replace plugin to replace your live site url with the new local url in the database.
Got any questions or comments?? go ahead! ![]()

many steps.. regarding to number 16, you can change php options for xampp or wampp or whatever you use. The attribute use short tags have to be enabled. For wampp, you can do this trough it’s quick control panel, right click on taskbar icon and you will see the php settings menu.
Thanks Lucian, I’ll add a note to number 16.
I am also a WAMP user.
WAMP is a decent tool indeed and has some built-in features that can make it even easier to use than XAMPP. However, XAMPP is still a bit more popular and an app I’m used to, so I decided go with it instead.
“plugin to replace your live site url with the new local url in the database.”
I like to use Velvet Blues Update URLs
Sam, does this plugin replace urls in both the database and the theme files? Just curious, even though theme files should not contain full path.
This tutorial is great, thanks.
Having done the testing locally, I’m thinking about the best way to update the remote site with the changes. Is the best way to simply synchronise files in the wp-content folder?
@James – before synchronizing the files you should make sure only the desired changes were made on the local files, and no additional changes.
To be on the safe side, you can compare the live files with the local files to see that no other changes were made.
Good luck!
Everything went well till step 15. I encountered the following problems later on:
Step 16: When I found and replace <? with <?php, all the functions changed to <?phpphp. Then I reversed the change to <?php replaced it with <?. Do you think this change will casue any problem?
Step 17: I am unable to execute this step. What is the search string to use and in which application dreamweaver or phpmyadmin?
Hi Nadir,
if you reversed the change correctly there should be no problem.
Regarding step 17 – it is an optional step that should be done only if you used your full URL anywhere in your theme files. If you did, you should search your site (in DW) for the full URL such as http://mishal.com.pk/ and replace it with the local URL you created (for example localhost/mishal/)
Thanks Omer for the quick reply. I am facing another problem in designing my site locally that is when I open a page from my theme folder like page.php in dreamweaver, I cannot see the actual page with images in the design view. All i see is some php tags and image placeholder icon. Thanks again for helping newbies like me. I am using dreamweaver mx2004 with xampp.
Also one more issue is:
When I open dashboard of my wordpress (by logging in at http://localhost/mishal/wp-admin), the URL for ‘visit site’ (top left corner) still points to http://www.mishal.com.pk. Thanks in advance.
Nadir,
Regarding design view in DW – I work with DW CS4, so it has an option called “Live View” for previewing the design of my local site. I’m not sure how it works in previous versions of DW. If you install CS4 and need help in configuring the testing server, tell me.
Regarding the URL for visit site – make sure you did step 11 properly, also take a look in the video how it’s done. tell me if it works.
Thank you very much for yet another first-rate article. I am always searching for original WordPress tips to suggest to my readers. Thanks for creating this article. It’s exactly what I was searching for. Truly great post.
Great article and site. Hadn’t visited before but I’m sure I’ll be mining your site for while looking for tips and hints. Having a bit of a problem moving a site to local though. The site is WP 3.0.1 and has a two subsites with it as well, so the tables actually start with WP_1_ , WP_2_ , etc. There are also tables with the straight WP listings. Kept getting errors connecting to the database until I changed wpconfig to look for WP_1_ as the prefix, but now I just the site’s 404 page. Any thoughts? Thanks again for the great tips!
Hey Josh, this sounds like it might be an htaccess problem.
When I move WP sites I sometimes get error pages as well so I install wp super cache plugin. Besides increasing loading speed, it can also fix htaccess problems in certain situation. Just remember to set it to enabled.
Good luck.
thank you so much for this tutorial! I actually have tried others but this one was so straight forward. I ended up using WAMP and was able to follow along easily.
Thanks!
Hi MGA, glad I could help
why cant i do step 6 and 7 at once….it makes no sense…
what folder are you talking about in step 7?
You can’t merge steps 6 and 7 because each is copying from a different folder, in 6 you copy from the new WP you downloaded, and in 7 you copy only wp-content from the backup you created to your live blog
I have followed all these steps several times. I can access the backend via localhost but the front end has a series of errors, then only partly displays the page.
Warning: Parameter 1 to ec3_filter_posts_where() expected to be a reference, value given in D:\Program Files\xampp\htdocs\wp-mdba5\wp-includes\plugin.php on line 220
Warning: Parameter 1 to ec3_filter_posts_join() expected to be a reference, value given in D:\Program Files\xampp\htdocs\wp-mdba5\wp-includes\plugin.php on line 220
Warning: Parameter 1 to ec3_filter_posts_groupby() expected to be a reference, value given in D:\Program Files\xampp\htdocs\wp-mdba5\wp-includes\plugin.php on line 220
Warning: Parameter 1 to ec3_filter_posts_orderby() expected to be a reference, value given in D:\Program Files\xampp\htdocs\wp-mdba5\wp-includes\plugin.php on line 220
Warning: Parameter 1 to ec3_filter_post_limits() expected to be a reference, value given in D:\Program Files\xampp\htdocs\wp-mdba5\wp-includes\plugin.php on line 220
Warning: Parameter 1 to ec3_filter_posts_fields() expected to be a reference, value given in D:\Program Files\xampp\htdocs\wp-mdba5\wp-includes\plugin.php on line 220
Do you have any idea how to fix this? I can’t find any plugin called ec3.
Jill, it seems that this function is related to Event Calendar 3 plugin. Don’t you have it installed?
If you do, then there might be a mistake with a function you manually entered into one of the theme files?
Very straight forward tutorial. Will use this a lot for design work, especially for new codes.
But one question: Is it possible to do a backup so that i always have the new content (articles) on my localhost? And which files do i have to backup/download via ftp?
I´m new to blogging but i like the way of the combination of writing and design work in wordpress.
kimaschreck, all the content/articles you have in the site lies in the database file and not in the theme files. Therefore, once you import the db file, you should have all of them in your localhost.
If it doesnt work for you, you can go to Tools menu-> Export (in the admin panel) and then Tools->Import in the localhost
i’m some database error