Exporting and Importing WordPress: Content and Full Site Migration
To move a WordPress site to a new host, you need two things: the database and the wp-content folder (themes, plugins, uploads). Then you fix the site URLs. The old method of editing a SQL dump in a text editor is dangerous today, because WordPress stores many URLs inside serialized data, and a blind find-and-replace corrupts it. Use WP-CLI’s search-replace, or the built-in Tools → Export when you only need content.
This guide covers both approaches: the content-only export and import that ships with WordPress, and the full migration you do with WP-CLI when the whole site, including settings and users, has to come along.

Content export or full migration?
Pick the method by what you need to keep.
| Goal | Method | Carries over |
|---|---|---|
| Move posts, pages and comments into another site, or keep a content backup | Tools → Export / Import (WXR file) | Posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies, users |
| Move the entire site to a new host | WP-CLI database export plus a copy of wp-content |
Everything in the database, plus theme, plugin and upload files |
| Local development to production without a command line | A migration plugin | Depends on the plugin; check that it handles serialized data |
The WXR export does not copy your theme, plugins or settings, so it is a content tool, not a migration tool. WordPress documents the export file contents on its Tools Export screen page.
Option 1: Export and import content from the dashboard
- On the source site, open Tools → Export.
- Choose All content, or pick Posts or Pages and filter by category, author, date range or status.
- Click Download Export File. You get an XML (WXR) file.
- On the new site, install the same theme and plugins first. Custom post types and taxonomies registered by plugins must exist before import or the content has nowhere to land.
- Open Tools → Import, install the WordPress importer when prompted, upload the file, and map authors.
- Tick the option to download and import file attachments, so media comes across.
Large sites can hit upload size or timeout limits. If the file is too big, export in slices by date or content type, or switch to the WP-CLI method below.
Option 2: Full migration with WP-CLI
WP-CLI is the command-line tool for WordPress. Most managed hosts and local tools such as LocalWP and WordPress Studio include it. It replaces the phpMyAdmin clicking from the old workflow.
1. Back up the database on the source
wp db export site.sql
wp db export runs mysqldump with the credentials from wp-config.php. With no filename it creates one from the database name and date. You can limit it with --tables or skip tables with --exclude_tables.
2. Copy the files
Archive wp-content. You do not need WordPress core, since the new host installs a fresh copy.
tar czf wp-content.tgz wp-content
3. Prepare the new host
Create an empty database and a user with access to it, install WordPress core (wp core download), and create wp-config.php with the new database name, user, password and host. This is the step the old guide called changing the config; the idea is unchanged, only the hosting panels look different.
wp core download
wp config create --dbname=newdb --dbuser=newuser --dbpass='secret'
tar xzf wp-content.tgz
wp db import site.sql
4. Replace the URLs safely
Your old address lives in the siteurl and home options, in post content, and inside serialized values from widgets, page builders and plugin settings. Editing the SQL file with a text editor changes string lengths and breaks those serialized values. wp search-replace understands serialized data and rewrites it correctly.
wp search-replace 'http://old.test' 'https://example.com' --dry-run
wp search-replace 'http://old.test' 'https://example.com'
Always run --dry-run first. It performs the full operation and prints a report without saving anything. Useful flags:
--skip-columns=guidleaves post GUIDs untouched; they are identifiers, not links.--all-tablesincludes tables outside the standard WordPress prefix.--preciseforces PHP processing for every column; slower, but safer with unusual serialized data.--export=file.sqlwrites the result to a file instead of the database, which is handy if you want to review it first.
Flush caches and permalinks afterwards:
wp cache flush
wp rewrite flush
These flags are listed in the search-replace reference.
Option 3: Use a migration plugin
If you cannot use a shell, a migration plugin packages the database and files and handles the URL rewrite for you. Whatever you choose, confirm it rewrites serialized data, supports your site size, and is actively maintained. Test on a staging copy before touching production.
Block themes and the Site Editor
With a block theme, your header, footer and templates can be customized in the Site Editor and are stored in the database, not only in theme files. A full database migration carries those edits with it. A WXR content export may not reproduce every design customization, so for a redesigned site prefer the full migration, and keep your theme in version control so its files travel separately from content.
Post-migration checklist
- Visit the front end, a few posts, and the login page. Check that images load over HTTPS.
- Re-save Settings → Permalinks if inner pages 404.
- Check Settings → Reading and decide whether search engines should index the site. A staging site should discourage indexing; production should not.
- Confirm forms, email sending and scheduled tasks work from the new server.
- Keep the old copy until you have verified the new one. A local copy also makes a convenient place to test updates, as covered in Installing WordPress Locally.
Common problems
Error establishing a database connection: the credentials in wp-config.php do not match the new database. See Common WordPress Errors & How to Fix Them.
Site redirects back to the old domain: the siteurl or home option still points at the old address. Run wp option get siteurl and fix it with wp option update, or rerun search-replace.
Broken layouts after import: a plugin or theme was missing when the content was imported. Install them and run the import again, or migrate the database instead.
Slow site on the new host: see How to Speed Up Your Slow WordPress Website, and lock the site down using How to Protect WordPress Sites before launch.
If you are also building the theme itself, Building Custom WordPress Theme is the companion piece to this guide.
Um, how about copying your theme over and then using the wordpress export/import feature?
@Aaron – Yes, you can use the export/import feature built-in WordPress, but then you have to re-do the settings and re-activate the plugins.
mmm…interisting enough, especially in replacing SQL script text with text editor like notepad, thank’s alot
recently i moved my page from the dev server to the final server, it’s really easy. good tutorial series nick.
I just get a blank white screen when I go to the new blog again after going through all the steps above. I’m stressing out that I’m never going to get this to work for me… :(
If you’re using mod_rewrite permalinks and moving from localhost/my-site to my-site.com you’ll also need to modify the .htaccess file in WP root.
@Masey You just need to reactivate your theme on the design page.
strange info about local url replacing 8(
I always think that wordpress is good enough do not store absolute URLs
I would have thought another benefit of doing this is it will copy over things like category ID’s which will save you having to search your theme for where you’ve excluded cat’s etc.
Handy post btw, thanks very much!
What about using the real domain as local domain so you don’t have to do any editing while migrating?
Go to:
C:\Windows\System32\drivers\etcand open the file “
hosts” with notepad.Then add the domain for each site your develop:
127.0.0.1 www.example1.com #For browser access
127.0.0.1 www.anothersite.net
127.0.0.1 www.yetanothersite.org
Install xampp (I don’t explain that):
And then go to the folder:
B:\xampp\apache\conf\extraThen open the file “
httpd-vhosts.conf” with notepad.Under the document you see this:
DocumentRoot /xampp/htdocs
ServerName default
Then add the following (note that you use the right foldername for document root and server alias to get it right:
#Note that example1 is the folder name which can differ for
#the used file name
DocumentRoot /xampp/htdocs/example1
ServerName www.selectedimpact.nl
ServerAlias localhost/example1/
DocumentRoot /xampp/htdocs/anothersite
ServerName www.anothersite.net
ServerAlias localhost/anothersite/
DocumentRoot /xampp/htdocs/yetanothersite
ServerName www.yetanothersite.org
ServerAlias localhost/yetanothersite/
[Note that you disable the domain name in the “hosts” file when you want to see the “real” website.
Have fun with it!
oops. in my previous comment wordpress swallowed parts of the code so its not usable in the httpd-vhosts.conf file.
So you need to put everything between the usual brackets like is used in html and in this example I replace it with [ and ]:
[VirtualHost *:80]
DocumentRoot /xampp/htdocs/example1
ServerName http://www.example1.com
ServerAlias localhost/example1/
[/VirtualHost]
etc. for the other sites you want to add.
Good tutorial. Definitely want to mess around with things on the local drive before go live.
Thanks so much… very excited to finally get my own wordpress theme up
HI Nick – If I wanted to integrate a wordpress blog into my website – I can still follow this tutorial so I can just write the blog directly in my site once I follow these steps correct? I just want the WordPress directly in my site – like: http://www.mysite.com/blog – is this ok? Let me know! Thanks again. Great tutorial!
Awesome Tutorial! I think I’m going to have to change my website to a wordpress site!
@Michelle Lana – Yes, just install WordPress in a new folder (ie. “blog”)
Hi Nick, following step 2. (Find & Replace All Local URLs) It also imported categories, links etc..?
Importing the file usually those features are not imported or wrong!
thanks
Do you have a more tut’s about export/import?
hmmm, thanks for this timesaver…
i made it a couple of times like this tutorial, but didn’t thought about to open the sql file in the text editor and use the really basic and timesaving function “find and replace”…
oh, sometimes it is hard to see how easy life could be… ;-)
good job. greetings from kiel/germany
Hey, thanks for the timesaver! =]
Im just getting into wordpress, so this will help me comign from my local server’s.
I have just explained this very process to a colleague, so I am really pleased to see an article written about it should I need to explain it again.
My god I should have see that before…
HI Nick, if I am doing this for someone else – and integrating their blog into their site like I mentioned earlier, do they need to download anything in their part? I am creating it on my mac, they are on a pc- once I am done with everything and they want to post now on their blog – do they need to do something first? Can you let me know? Thanks Nick. Really appreciate it!
one thing you didn’t mention… you must also find and replace the e-mail address you used when creating the wordpress installation… if it’s different, that is. If you don’t do this you can change the admin e-mail setting in wordpress, but I ran into a problem because somewhere in the database it held onto the old e-mail address and was sending site message to the old e-mail address… just fyi
WordPress is epic failure, stop pushing a craptastical cms
You know, searching and replacing the sql file is such a simple perfect idea – that I have never used. I hunt and peck through phpmyadmin to change the urls. This goes into the “Why didn’t I think of that!” file.
Thanks so much for sharing. Your posts are always worth a look, even when they focus on things that I think I know how to do…
Another informative article. I’m still not personally sold on WordPress but I do understand why it is so popular and I can appreciate its ease of use. Keep it up.
Thank you for sharing your knowledge, it’s highly appreciated.
Question tho – What kind of font are you using?
Thank you
I still think WordPress is the leading CMS for standard blogs, which is mostly down to its simplicity, wide spread support and plug-ins. There are others I like though such as MovableType, which handles multiple blogs very well. Anyway, thanks for the tutorial Nick. Very useful.
– CMHB.com
I got lost right away, because in step #1 it calls to log into phpMyAdmin. The screen is totally different than the one shown. I am using PHP 5.2.6 and MySQL 5.0.51b.
Apparently the layout has changed considerably, making the first part of the instructions useless because there is nowhere to go once the tables have been selected.
There is no Structure field, to tick “Add DROP TABLE / DROP VIEW”. There is however a “Create new table on database wordpress” field that requires to be filled in along with “number of fields” before “Go” can be clicked.
So you see that I am unable to continue until that gets clarified for me. Would it be possible that the instructions be updated using the most current PHP and MySQL?
Thanks,
Ernie
This actually is easier than it sounds.
I had so much troubles in do this in my blog, i almost quit!
I would like to know how to do the reverse: export my remote wp install to my local Mac to test out changes, etc, while not live to the world.
Hey Nick,
Great set of tutorials you’ve put together here… Absolutely love wordpress and all that it’s able to achieve.
Just one last step you might like to cover would be a tutorial on upgrading your version of wordpress?
I think this post would be very useful for any newbee or to be bloggers who would like to use the world’s best wordpress as their blogging platform.
This is very helpful and very useful as well.
Hi,
Not sure if this has been mentioned yet, but before importing your .sql file into PHPMyAdmin on the new site, you should search through it with your code editor and change all instances of ” to ” so that any images etc. that reference your localhost environment reflect your live environment.
If you don’t do that, any images etc. in your content probably won’t appear because they refer to localhost and not your live URL.
Ah,
Stupid me, I didn’t read your tutorial properly! I see you’ve already mentioend about localhost!
Scrap my last comment about writing an article about upgrading your version of wordpress…
With the release of WordPress 2.7 it’s as simple as clicking a button :P
This actually is easier than it sounds.
my blog
This is a very useful tutorial as I recommend everyone who has a word press theme to switch to your domain name because you never know when word press decides to reactivate your blog.
Nice tutorial. These are helpful. I had done the url replacement using SQL but hadn’t thought of the text editor option before. For those reading, be careful what text editor you use as it may change the quotes and lead to an issue.
thanks. nice post, great tutorial.
you can try this step to import your wordpress blog to joomla powered site/blog
Great tutorial over exporting WordPress but there needs to be a step six, especially for noobs.
6) Go to Settings > Miscellaneous > Store Uploads in This Folder
Change server value to:
/wp-content/uploadsIf you fail to do this, you will get errors whenever you try and upload multimedia onto your http live site via the wordpress uploading interface.
Great blog by the way,
j
hi everyone…i’m having some problems with a blog…I’ve followed many times this tutorial…everything works perfect locally.
When I upload it to my host, then something goes wrong…
Pages never seems to work…
This is what i’m talking about…
Thanks in advance to anyone who’ll answer…
I’m trying to move my wordpress blog to a subdirectroy () but getting a database connection error. I’ve modified the .sql file to reflect and the wp_config file. The blog works if I upload it to the root public_html directory but not the subdirectory. Is there something I have to do to the mySQL db or something?
I’m doing this because it will be used under an add-on domain once I get it uploaded and tested. I’ll then change the DNS.
Hey Brian, I’m having the same problem…would the kind gods of the web designer wall please assist us?
I’m having problems with this: Login to your server cPanel, go to MySQL Databases, create a new database and assign a user. Now go to phpMyAdmin, select the database (the one that was just created) from the dropdown, click on the Import tab, browse the SQL file and click Go. Can anyone help?
Brian and christoball, under Settings->General Settings there is a place for Blog Address. Did you put the subfolder name in there? Just a guess.
Fritz, If I’m not mistaking…by updating the .sql file with the new URL this should update the field you are referring to. So I did update all the URL’s in the .sql from my localhost to the new domain/subdirectory. If I’m wrong…I still can’t change this field because I can’t even login into WP without getting the database error. So in other words…I can’t get to WP in anyway because it won’t connect to the database.
Does this have something to do with the .htaccess file?
I’m using a mac and mamp. Is there anything like Cpanel for the mac?
Please help:)
Hi thanks for this tutorial.
but i got a some problem wordpress plugin such as wordpress sitemap
I do like this post very much, thanks. I can work off-line now.
I have followed the tutorial so many times, but its not working for me I am afraid. it apprears that only the home page is working and nothing else, the links for pages, images are not working WHATSOEVER
I have been on this code for about a week now and I can’t find a solution, I even replaced all the links in all localhost/mysite files with my website domain (because you see I want to see my site under the domain, not domain/wordpress folder); but alas I am bereft of Ideas
please any suggestions are more than welcome here!!!
I’m having the same problem as calliope, everything works perfectly locally but once I moved the site to the server none of my links work.
I was having trouble with importing the database to the server, so I did a fresh install and imported all my posts and pages, they are all showing fine in admin but any links to pages or posts return a 404 page not found error and even previewing posts or pages from the admin does the same thing.
I’m pulling my hair out, any ideas?
Hi, what´s is wrong when the css not seams to be active and when a click on a link it point me to my http://www.xx.com and not to my subfolder. where everything is placed.
Thanks a million, it on the worked second time. That’s excellent for me.
I had to make sure step 2. (Find & Replace All Local URLs) was entered correctly.
From the bottom of my heart thank you. Muzza!
If you have uploaded any attachments you will want to change the path(s) to the file(s) as well (/path/to/local/site/test.jpg -> /path/on/host/server/test.jpg).
When make any replacements you need to use caution and watch for changes made in a serialized value. It is likely you will be changing the length of the string and this may cause the serialized value to break.
If you do make a change to a serialized value you simply need to update the string count (s:5:”tests”; 5 in this case) with the correct count.
yes man,
thanks a lot
me too i can work offline
my best regards
well if you have a BIG database, it will be a little annoy to open de .sql and chage and replace..
I think is better doing this .
After you import your DB to the new location…
then you should make a quary.:
To update WordPress options with the new blog location, use the following SQL command:
UPDATE wp_options SET option_value = replace(option_value, 'http://old-domain.com/', 'http://www.new-domain.com/') WHERE option_name = 'home' OR option_name = 'siteurl';After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:
UPDATE wp_posts SET guid = replace(guid, 'http://old-domain.com/','http://www.new-domain.com/');If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:
UPDATE wp_posts SET post_content = replace(post_content, 'http://old-domain.com/', 'http://www.new-domain.com/');Browse through WordPress blog to check if everything is okay. You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.
Remeber always to have a backup
see’a
Great Tut.
THANK YOU FOR ALL YOUR TIME DOING THESE FOR ALLLLL OF US! Unfortunately, I am having an error though when I try and import the db ‘localhost.sql… I have tried a few times now – It says:
Error
SQL query:
—
— Database: `information_schema`
—
CREATE DATABASE `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
MySQL said: Documentation
#1044 – Access denied for user ‘root’@’localhost’ to database ‘information_schema’
Any help would be so appreciated.
Thanks!
what about if i want to set one up in another folder say .www.example.com/themes
the themes folder being the folder where i would want to put wordpress in, anything to watch out for?
WordPress 2.7+ finally has an import/export wordpress option. First step is to upload your theme to the themes folder on your server, then on your local host, export the wordpress file (it’s an xml file), and on your live site, upload it. Voila, done.
Hi! I’m planning to move from one server to another and I’m using drupal. Do i follow the same process for drupal as well?
Hi, you said this is for backup purposes. So, if someone creates a new post in WordPress, will it automatically show up in the website or does it need to be imported each time? I am new at using blogs and trying to find better ways to incorporate them into a site.
Thank you!
Thanks for the post. You made it so easy! But I read it somewhere. It is best that you uninstall the theme first.
You rock! Thanks for the step-by-step. It was very easy with your help. So many other tuts are way too technical for designers. I created my first theme locally and put it up live today!
Thanks again! Calvin
Thanks man, this is great. I learn a lot from your tutorial, in fact, I created my web following your guide here starting from install WordPress Locally, Useful WordPress Plugins, and finally this one… Export my web.
You Rock!
Hi,
Thanks a lot for this – I was able to export/import my WordPress but at first my images weren’t being uploaded to the right place (I use Windows Live Writer)
The problem was that in my .sql file, the ‘upload_path’ was hardcoded to ‘xampp/htdocs/wp-content/uploads’, which lead to my images being uploaded to the wrong place. I had to replace this with my siteurl (which was not detected when I did a localhost find and replace) to get it working.
It cost me a day in coding so I’m hoping that I can help shed some light on those who come across the same problem.
Excellent tutorial though! :)
Cheers,
Adam
Exporting Problem at PhpMyAdmin
I got this problem after click the GO button:
export.php: Missing parameter: what (FAQ 2.8)
export.php: Missing parameter: export_type (FAQ 2.8)
Please kindly explain how to solve this problem?
Please email your answer to [email protected]
I’m struggling through this series and have just come to this tutorial. Perhaps I should know how but…
“Login to your server cPanel, go to MySQL Databases, create a new database and assign a user.”
Is a bit much for me.
I’ve checked out a few C panel / WordPress tutorials and I’m not giving up.
I appreciate your time and effort, but this one may be too complicated for me
Wish me luck
Keith D
thanks for this great tutorial! i really had some problems regarding the exporting of the database. its a good thing that i have some knowledge with database manipulation.
and also many thanks for this post again! =)
Finaly a clear and simple tutorial on how to export a local database.After pulling out my hairs the last two day searching for a tutorial that is easy to use i`m praying on my knees to thank God my database is finaly up and running and its just so simple.Wordpress should implement this tutorial in theyr codex!Thanks a bunch.
I am having the same problem as Mindy. My error reads: ##1044 – Access denied for user ‘mark’@’10.%’ to database ‘information_schema’ .
Do you know how to fix this? I already have WordPress uploaded on my host server which may be the problem. However, I would like to do this without reinstalling it. Any suggestions?
This tutorial is great! I was worried that exporting the database and importing to the new host wouldn’t include all of the pages, comments, etc. I was afraid I would have to export the XML within WordPress as well. But that wouldn’t work because the exported XML file was too large (over 2MB) to import to the new host. So I’ll give this a shot. Thanks again!
Finaly a clear and simple tutorial on how to export a local database.
Overall a good tutorial, I see many are pleased with it. However, partially I find it hard to follow and actually the whole procedure didn’t work for me. Looking for a solution at the moment.
Hi, This tutorial is good to help me more to do it.
And I have one problem after I exported database then I explored it. It display two lines errow in .sql file
export.php: Missing parameter: what (FAQ 2.8) export.php: Missing parameter: export_type (FAQ 2.8)
does anyone know what I’m doing wrong?
Thanks
Hi Nick,
It is much easier to go to the wordpress-admin panel -> tools -> export.
The file which is created that way can be imported at the new site (admin -> tools -> import)with an existing installation. (It is advisable to delete all the pre-generated categories, posts and replies).
Thanks ! it worked great…. I only lost maps I did with mappress plugin…
All the best
Hi!
Thanks for making a tutorial. I have followed your instructions and I have more or less transported my wordpress from one domain to another domain on the same host server. The home page loads without problem. (I only lost the about information)
However I have other more pressing problems. I keep getting this error message every time when I want to access individual pages or posts such as
404 Not Found
The requested URL /kennel does not exist
In WP admin I see all the posts and pages. But somehow the database has not constructed the pages in the process.
Anyone have any idea what is going on and tip how I can solve it?
If I use keywords and the search button I get the posts or page. For instance if I search for oppdrett, a key word I know is located on the “kennel page” I have more luck and I found this entry:
give me the page. But it seems like MySQL has not made entries for the permalinks that can be seen inside Wp admin.
I hope I am able to make myself clear.
Thanks!
Thank you for your easy to follow articles on WordPress. Installing and building themes was simple due to your excellent instructions. Thank you VERY much.
I followed your instructions and everything went well (so thanks very much!) except for one problem that I solved myself, so you should add another step to do before uploading the wordpress folder via ftp:
in case someone has set up permalinks, the .htaccess file has to be modified.
excellent help these articles. Created a wordpress theme and went from local to live based on these articles.
There’s no widgets in the GlossyBlue theme. Bummer.
Great info but my needs are simpler.Can you explain the basics of merely exporting a theme from ne of my existing blogs to my harddrive. I just want to be able to upload that same theme again and again. Thanks.
Andrew
Coffs Harbour Australia
your website theme is very beautiful.
thanks for content.
Thank you for a great tutorials, very handy and useful. I use one database for localhost and website, so I don’t have to export/import my database. Less work is better :)
Great article (as usual) – but I’m finding that if you setup a WP site in MAMP that it still sees the htdocs folder as the ‘root’ of the site and not the actual site folder itself. Is there a way around this so you don’t have to make adjustments from the live version of the site in terms of relative linkage?
Hi everyone,
I just wanted to let the users who are having the 404 issue after performing the export/import that it takes a few minutes for the data to propagate.
Give it 10 minutes or so and the links should work properly. I was worried after performing the above steps, but after a few minutes the 404 issue went away…hope this helps.
Thanks for this guide. It will help me transfer my post from blogger, as xml files are much eaasier and the only way from blogger to wordpress!
Hej there,
thanks for those three very helpful tutorials,I transfered my local WordPress installation using this, so it worked quite fine for me. Perhaps you should recommend using a MySQl 5.0 database when you are setting up your domain in the hosts portal, that’s the only issue I had to deal with.
So far
why does my jquerry won’t appear in my page???? and my wordpress page is all messed up…. need help very badly…. thank you…..
You’re a star.
I’ve read loads of ‘how-to’s’ about WordPress where nobody really explains how to easily move or clone a WP site.
You’ve done it perfectly.
Bookmarked, thank you.
Do you need to change the database as well when you go through and change the localhost? Or just the local host?
Thanks for the info.
Also, I like the theme too.
cheers
Thanks for this tutorial, although following all the steps in moving from MAMP local set up to upload to client server all I get is “Error establishing a database connection.” I have tried 3 separate times to no avail. Please advise – ANYONE!
Thanks!
Kevin
All good from local to online. Now how would you go about duplicating a online site or moving to another domain with different database. Keeping all the images and post.
Thanks a lot works like a charm …Great resource …
hello.
got a problem, I downloaded the database from example1.com, I then changed all the domain names in the sql file from example1.com to example2.com and uploaded.
that was ok. I then went into the wp-config.php and changed the wordpress database name from the original number to the new database number.
the result was that I got an error message saying it couldn’t connect with the database.
I’m thinking there is an obvious oversight. Can anyone help??
I just noticed Kevin had the same problem on 29th april. aren’t replies shown here?
Hey, thanks for the tutorial, it has really helped me out! The only step you seemed to have missed with exporting is changing the wp_options in PHPMyAdmin. See https://thethemefoundry.com/xampp-wordpress/ – “a couple quick changes” heading. Just thought that may help some people out!
Awesome guide! Just what I needed, I just ran into one problem I hope you can help me with. After exporting and importing the db, my content is only viewable when logged in to the admin backend. If logged out, the content is not visible.
The layout and theme are fine, but I get the “There’s nothing here.
If there were posts in the database, you’d be seeing them. Try creating a post, and see if that solves your problem” message.
Any ideas?
Nevermind, I actually fixed the issue I just commented about..it had nothing to do with the database at all. This guide worked perfectly.
I did exactly what you did to upload my local MAMP-based site to ipublica.com, with one exception. I changed manually, using a text editor, all instances of ipublicacom:8888 to ipublica.com, in the sql file before importing the database to the server. All worked fine but I observed that the server changed my login settings to my local login settings. So thanks for the idea that I of course need to edit the config file on the server. Maybe even that I do not need to replace all URLs in the sql file, and can do this by simply editing the config file on the server? Let me try this:)
Thanks.
Pierre
Hi!
Thanks so much for all the help! This tutorial is the best I’ve seen.
However, I have one hang-up. I went through the steps and now when I try to access mydomain (www.edwinblue.com) the “:8888/” gets added into the address and the site won’t load.
Possible Issues:
When I setup my MAMP server I just made it “” I didn’t include “mysite”
When I went to update my wp-config file it appeared that all the settings were already correct. ??
Lastly when you say upload the entire “wordpress” folder is that the same as the “wp-content” folder?
Someone PLEASE PLEASE PLEASE help!
Thanks in advance,
Drew
this post is really helpfull regarding import & export in wordpress
Excellent tutorial. Easy to follow, complete and very useful.
A quick question. Let’s say I continue to modify the local environment, would it be a simple matter of following all the database export/import steps again to re-incorporate?
(I’m not going to be complicating things by continuing to modify the database in the target, testing environment)
Thanks again!
I’m having the same issue as Drew from comment #162. 8888 is being automatically added to the end of my URL and nothing comes up.
I’m working on a client’s website locally and am confused with the directions in Step 2. I’ve tried replacing just the local URL with my domain name. Do I also need to replace all instances of “localhost” with my domain name? In trying just the local URL with my domain name, I’m still getting the local links to show when going anywhere but the start page for my domain.
Find and replace all local URLs with your domain URL (eg. replace all “” with “http://www.yourdomain.com”).
I usually replace all folder pathways in the db data as well, I found sometimes certain plugins point to old folder paths, I noticed no-one ever recommends this step. don’t you think it’s necesssary?
Hmm.. Just a bit confused about step 4: Upload WordPress folder to the server. How is this done?
Thanks for any help!
Kat
8888 is being automatically added to the end of my URL and nothing comes up
being automatically added to the end of my URL and nothing comes up.
Which databases has to be selected with the local phpMyAdmin?
hi i am doing same but its coming a blank screen
Just curious, how does one go about getting the gui to display in ubuntu? I can access phpmyadmin in the terminal, but I want to use the fancy gui like you have done.
Thanks!
Hey, you have done great job. Nice work. Thanks for that.
Los Angeles Web Design
Great share. I have a question, Could you share more information about white iphone 4?
White iphone 4 Conversion Kit is now the hottest iphone 4 piece that you should get!
Hey i did everything the tutorial told me to do, but my pages arent working. Im getting an internal server error. My front page works fine but the rest of the site doesnt seem to be connected… do you have any advice
It happened the same to me…. looking for answers…
Apparently the permalinks settings were not exported. I putted the permalinks settings back to default, and it worked.
Now we need to find out how to make the permalinks work with the other settings…
Hi,
Something goes wrong…. if I open the page, automaticly :8888 is added.
What to do?
Thanks!
For the people have the auto insertion of :8888 problem. Go to phpMYadmin on the Live server and do a search for 8888, you will see that it still appears a few times in the wp_options table, ie. for ‘siteurl’ etc. It should only appear in a few fields. Edit these fields manually pasting in your Live URL. Now, everything should work properly…
Hi,
Something goes wrong…. if I open the page, automaticly :8888 is added.
What to do?
Thanks!
Does this work the other way around as well?
I mean can I make a local copy of my online site this way?
How can I use this process with 3.1? I have multisite locally, but need to move only 1 subsite online. I can export the single database, but not upload the whole wordpress folder cause it includes all my other site as well.
Please help!
oh man, your the best. I’ve never done this before and i;ve been struggling with this problem. Got it all solved finally. I just want to say THANKS.
Totally covers exporting local WordPress to a web host. Awesomeness!
It’s more like thinking outside the box right?
How do I know what my host is?
Will I still be able to change and update my website locally, and then just upload the files to the web host?
Thank you very much for such a wonderful tutorial. My web hosting client was suffering how to make his WP site online. I googled and found this link. I gave him the link and he is almost successful.
Thanks,
San
I’ve been trying to upload my wordpress but no sucess but now with your detailed description.. Perfect !!.. you guys are the best
There is a deep-rooted issue with this method. WordPress relies on PHP serialization for datasets stored within the database. The format of serialized PHP includes a character count. If this character count differs from the original it can unserialize incorrectly and screw up settings.
Specifically plugins and widgets are first and most obvious effected. The proper albeit more complicated method is to unserialize these with PHP, then replace and reserialize. It’s a stupid issue that could have been avoided in wordpress used JSON.
I was so happy when I found this because it helped me get further than ever. However, I get this message:
SQL query:
http– phpMyAdmin SQL Dump
— version 3.3.9.2
— https://www.phpmyadmin.net/
—
— Host: localhost
— Generation Time: Aug 13, 2011 at 08:18 PM
— Server version: 5.5.9
— PHP Version: 5.3.6
SET SQL_MODE = “NO_AUTO_VALUE_ON_ZERO”;
MySQL said: Documentation
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘htt
When I get to step 3
Login to your server cPanel, go to MySQL Databases, create a new database and assign a user. Now go to phpMyAdmin, select the database (the one that was just created) from the dropdown, click on the Import tab, browse the SQL file and click Go.
I’m usng MediaTemple and there is a “manage your databases” in the admin. I can easily create a new database (I believe, however, it is a ‘virtual’? database…? if that makes a difference) and there is no place to assign a user (as I already have the database for the account.
Very confusing, but I’m wondering if this is the problem.
Any help is greatly appreciated.As I say, this has gotten me the furthest in two years!
I am wondering if it’s easier to just upload the new custom theme into the wordpress theme folder and not mess around with any config files? That seems to work pretty well for me. Any thoughts Tyler?
Very usefull article, but i’m still need to edit my style.css file. but it’s ok now, thank you for sharing this..
This has got to be the best tutorial out there…simple and to the point. Thank you, Nick for creating this. I’ve referenced to this post several times to make sure I do it the right way.
AM currently trying to create a local word press. anyways i have intentions of making it live. i installed XAMP and have installed word press. its working great locally. i want to add more stuff on it still though. well i want to know how to make it live and i want to host it myself. am not exactly a newbie to wordpress but i have never made any webpage or site live. i need help making my wordpress live. am googling some info and ama attempt some of them.
i need help making my wordpress live. am googling some info and ama attempt some of them.
I am getting error code 1046 while importing MySQL database. Please help me to escape out of this error.
It’s nice tutorial, but i think better\easier way is to export xml file from wp dashboard, and to import it to new host like it’s described here…
http://wordpress.org/support/topic/using-importexport-when-moving-wordpress-to-a-new-host
But there’s more involved than just the stuff that wordpress gives you with the export xml file. There is theme options, widgets, etc.
Thanks! It’s very useful, but I don’t understand: if I want to export my local WordPress into WordPress.com, how can I do that? Do I need to put the local WordPress folder into the export/import section? It’s said it only works for comments, posts, etc..
Thanks.
hello there
it was the best tutorial i found out to import my wordpress site from older to newer one. i am still confused and did not be able to do what i wanted to do so. i have old site using all the same version of wordpress with all the plugins installed in new one, tried to import mysql using phpmyadmin but give me duplicate posts and error which ended in failure to import all my data. i replaced all my old domain name in the imported sql file using text editor as well and data base too changed. i will try again and may ask you fine people for help.
Thanks for nice post.
Awesome as always, Thanks. I usually hate anything to do with the databases but that made it so simple. It didn’t hurt at all!
Short and simple tutorial, but direct to the point, it’s what I’m looking for to transfer my other WordPress database to a new host. Thanks Nick, cool as always.
I loaded wordpress locally, designed the site, copied the files to the server, restore the database to the webserver phpmyadmin and changed the wp-config.php config file but it will not open the wordpress page, always says cannot find the database. I rename the .php file and recreate it and add the same database info and it connects to the database but i have to reload all widgets, themes and recreate all gallaries. All files are there the wordpress site just doesnt see any of them. Its like the database needs to recreate all the tables and then it works. Any ideas? P.s its not the database info in the .php file thats wrong. Could it be the naming of the database on my local machine and the nameing of the tables on the server?
Simple solution you’ve provide for the most complex process I was thinking before reading this tutorial. How to export WP database from one host to another ?
Thanks for the helpful info… WP doesn’t make it apparent how to backup the database.
so if I wanted to download a WP theme I already have loaded on a site running live would I have to copy all the folders locally in the WP themes folder … and change the wp-config.php file ?
well when i mean copy the files locally … I mean copy the folders from the server & then load them into my local WP theme folder.. yes
maybe all I need to do is copy the Theme folder locally from the server… yes ?
For a theme you don’t need to change the wp-config.php.
Just copy the themes map, usually has the map the name from the theme, from the website and place it in the themes map from the new site.
When you go to your admin panel and select themes you should see the newly added theme.
Hi
Great site, it gives straight fourth answers to thinks that look complicated.
I tried this reversed. So I replace all “” with “”. Downloaded the entire htdocks from my webserver to my local mac. Changed the wp-config.php settings.
But when I go to the site everything is blank. I think I missed something but don’t know what.
Before I did this, I had a clean WP running just to be sure that everything worked just fine. Witch it did.
I have completed steps 1-3 but do not know how to proceed with #4 and # 5. Can someone walk be through this? I am stressing out a bit with trying to get this done under a deadline and help would be greatly appreciated.
Thanks for the easy to undersand report. You have answered all my questions and save me a lot of time wondering what to do.
I have one more question: if you move from one hosting (Godaddy) to another, how to preserve the mailbox e-mails and move them later on to the new mailbox with the same name?
Thanks for the easy to undersand report. You have answered all my questions and save me a lot of time wondering what to do.
I have one more question: if you move from one hosting (Godaddy) to another, how to preserve the mailbox e-mails and move them later on to the new mailbox with the same name?
Thank you so much for this easy tutorial, and for sharing your knowledge, it saved me.
I’m a first time MAMP user (and first time WP user) and this made getting my site live, not quite a breeze, but definitely do-able.
i just want to ask… on step 4, “Upload the entire WordPress folder to your server” how do you upload the whole WordPress folder through phpmyadmin? Need help on that…
Anyway,
Thank you!
Not through phpadmin, but via your FTP client, or file upload on your server’s control panel. :)
Upload the entire WordPress folder to your server” how do you upload the whole WordPress folder through phpmyadmin? Need help on that…
Not through phpadmin, but via your FTP client, or file upload on your server’s control panel.
i have followed these instrucitons (skipped the custom template since i am using a purchased templagte) but my phpMyAdmin screens look different than yours and i can’t follow them since things are not the same. for example:
OK -Under the Export field, make sure all tables are selected
NO – THIS IS UNDER THE OPERATIONS TAB- Under the Structure field, tick “Add DROP TABLE / DROP VIEW”
NO DROP TAB, its under the export tab and then i have to toggle the custom field Tick “Save as File”
Then click Go and it will prompt you to download a SQL file
ok…then i go to the next set of instructions and import the data base and of course it shows me ERROR…can’t go any further. i have done this 500 x…..
can you help me?
MAMP version 2.1.1
Mac OSX 10.6.8
this is the error:
Error
SQL query:
/*!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 */;
—
— Database: `ftcWP_0915`
—
CREATE DATABASE `ftcWP_0915` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
MySQL said: Documentation
#1044 – Access denied for user ‘rburns’@’10.%’ to database ‘ftcWP_0915’
Thank you so much! This is the best manual on the net. Much better than worpdpress’ manual itself and better than my hosting company’s site, and that’s supposed to be their job. I use this manual with any new site i build, juts to make sure i do everything right.
For those asking how to transfer the files, best option is the use the free ftp software FileZilla. It’s all drag and drop and never does any problems in copying files from your computer to the storage server. The configuration details you can get from your tech support of the storage site.
Thnx again!
sasha
how to extract wordpress file in html.not xml please solve my problem….
I think you need to amend all your tutorial for the latest version of the WP and lot more changes are arrived to be updated.
else the content available on your site confuses with what is latest installed.
please note to update to up to date,
Hi Shan!
The date on this article is your best indicator that it probably doesn’t apply to the latest WordPress anymore. As time goes on, more updated articles will be added or Nick will revisit older ones to update them as he can. Cheers!