Switch hosts with wordpress when export and import do not work


WordPress and Switching Hosts

There are several ways of moving to a new server. My preferred one is using the Export/Import functionality found under Tools in WordPress admin. However, before moving, make sure your WordPress install is up to date. Then, go to Tools and choose to export the content. You’ll get a file containing the data.

Next, install WordPress on your new server. Any decent Web host will have alternate URLs to access your content on the server online, without actually having to have your domain pointing to it. When you’ve got a running WordPress install, delete the automatic pages and posts since these won’t be overwritten. You want the install to be clean. Now, download the wp-content folder from your old server, and upload it to your new one. Now you’ve got all your images, plugins, themes, and so forth in place. There is a built-in option in the post importer that will try to download the images from your posts to your new server, but it fails more often than not, so it is better to manage the static files in wp-content manually using your favorite FTP program.

Finally, you’re ready to import the exported file from your old server. Just go to Tools and go through the import wizard (see Figure 1-4), taking care that your exported file from the old server is up to date. Import it, let the script chew through the content, and then you’re all done! Verify that everything is working properly, give yourself a pat on the back, and then redirect your domain to your new server. You may have to edit your new weblog’s settings, since it may have taken URLs from the Web host’s internal system, so change them to correspond with your weblog’s domain name. While waiting for the domain to be pointed to your new server the weblog will break of course, but then again your old one is still working. You may want to close comments on it, though, since those will be “lost” when the visitor is suddenly pointed to the new server with your new WordPress install, which is based on the content of your old one at the point when you exported the file.

When Export/Import Won’t Work

Unfortunately, there are times when the Export/Import way won’t work usually because there is just too much content for PHP to parse in the import. This is only an issue if you have a big weblog, and possibly due to your host’s server settings as well.

If this is the case, you’ll have to do things a little bit differently. Ideally, you can recreate your environment identically on your new server, with the same database name, and the same username and password to manage it. If you can do this, moving will be a breeze. All you have to do is get a dump from the MySQL database using your favorite MySQL admin tool, and then import it into the new one. This probably means using PhpMyAdmin and the backup instructions from the WordPress Codex (found at codex.wordpress.org/Backing_Up_Your_Database). Here’s how you do it:

  1. Log in to PhpMyAdmin and select the database you want to back up.
  2. Click the Export tab in the top menu.
  3. On the left-hand side, make sure all the necessary tables are marked (the Select All link will help). This would be all of them, unless you have other stuffin the same database as well.
  4. On the right-hand side, you want to tick the Structure box checkbox, then the Add DROP TABLE box and Add AUTO_INCREMENT as well as Enclose table and field names with backquotes. Also tick the Data checkbox, but leave the choices within unchecked.
  5. Down below, tick Save as file and pick the kind of file you want to download, probably a zipped one.
  6. Click the Go button. This will download the database, which you will import on your new server.
  7. Importing a dump in PhpMyAdmin is even easier. Make sure you have created a database with the same name, username, and password as you had on your previous server. This means you won’t have to alter the wp-config.php file.

Import the dump to the new database by logging in with your favorite MySQL manager. If this is PhpMyAdmin, just select the database and choose the Import tab (sits next to the Export tab) at the top. Use the importer to find your downloaded dump, and import it.

Then download your full WordPress install from your old server, and upload it in an identical manner to your new one. Again, give it a spin using your Web host’s temporary addresses and make sure that everything seems to be working. Point the domain to the new server, and when it resolves everything should be running smoothly.

However, you may not be able to recreate the environment in exactly the same way. If this is the case, just alter wp-config.php accordingly; most likely it is the database name, username and password, as well as possibly the need for an external database server, that you’ll have to edit. Moving WordPress from one server to another may seem scary at first, but it isn’t as bad as it once was. Sure, if you’ve got a big weblog and aren’t comfortable doing stuffin database admin interfaces like PhpMyAdmin, then this may be a bit much. Get help, or give it a go yourself. Just make sure that you have all the backups you could possibly need, and don’t mess things up on your old (current) server, but rather on the new one. After all, you can always just create a new database and WordPress install there and give it another go.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Articleinput.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.

Note: This article was sent to us by: Sean Jovers at 05152010

Related Articles

1. Show off Your Twitter for Wordpress
Integrating the social web Before digging into the various techniques used to display and connect to the social Web, it is important not to forget the most ob...

2. How to do lifestreaming with WordPress
Lifestreaming with WordPress Lifestreaming is a term commonly used to describe the mashing up of everything you do online. A bit presumptuous, perhaps, to assum...

3. Social Web Submit Buttons plugin Worspress
Social Web Submit Buttons The social Web is certainly a big consideration when working with editorial content today. While search engines can trickle in visitor...

4. Wordpress Hosted Comment Solutions
Pimping the Comments With the addition of threaded comments in the WordPress core, and the excellent CSS styling options that are now available, as well as the ...

5. How to Backing Up database for Wordpress
Backing Up Anyone who has lost data in a hard drive crash or similar knows the importance of backing up, and it goes without saying that this applies to your on...

6. What you need to know about the Wordpress database
Hacking the Database Most of the time you needn’t worry about the database; WordPress will do that for you. There are database changes between versions so...

7. Do not share your MySQL user with any other system
Server Stuff The MySQL user for your WordPress database, which incidentally shouldn’t be shared with any other system, doesn’t actually need all wri...

8. What is WordPress core and how to use template tags
About the WordPress Core Any good CMS will keep its core files apart so that you don’t ruin the code that makes the system work, and WordPress is no excep...

9. Creating multiple loops might harm your WordPress blog
Alternatives to the Loop You may be tempted to create multiple loops or advanced loop queries in your theme’s template files when you’ve figured out...

10. How to do everything with your WordPress theme
WordPress Themes If you want to do more advanced stuff with WordPress, you need to understand theme essentials. Naturally, you can just start hacking the defa...