Title: Database error when exporting
Last modified: August 19, 2016

---

# Database error when exporting

 *  Resolved [Parenthetical](https://wordpress.org/support/users/parenthetical/)
 * (@parenthetical)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/database-error-when-exporting/)
 * This will take some explaining, but I’ll be as clear as I can:
 * I’m trying to export my database so I can switch to a new host (WordPress to 
   WordPress). My current host is a friend’s server, but I think it’s time to move
   to a paid hosting situation.
 * I was running a very old version of WordPress (1.5), but when I tried to upgrade,
   I discovered that my friend is running an old version of MySQL. I downgraded 
   back to 2.0, but I got a lot of errors in reading the Categories. So I went back
   to 1.5, which looks fine on the blog itself.
 * The problem is when I try to export, using the export plug-in. This is the error
   message I get:
 * > Please choose the categories you wish to export.
   > WordPress database error: [Unknown column ‘category_count’ in ‘field list’]
   > 
   > SELECT cat_ID, cat_name, category_nicename, category_description, category_parent,
   > category_count FROM wp_categories WHERE cat_ID > 0 ORDER BY cat_name
   > Warning: Invalid argument supplied for foreach() in /usr/home/web/parenthetical.
   > net/wp-content/plugins/wp-xmlmigrate.php on line 30
 * This error means I can’t export the xml file.
 * I’ve been using this blog for three years. If I started from scratch I’d lose
   literally hundreds of posts and comments. I’m at a total loss — all I want is
   a) a functional blog, and b) not to lose all my previous work! Any help you can
   provide would be fantastic!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702427)
 * Well, do you have access to phpMyadmin to do a direct export from the database?
   
   If yes, then do it. Next, install the same WP version on your own host as you
   used to have on the old location. Import the DB (.sql) file into the database.
   Then do the upgrade.
 * That’s a summary descritpion of the steps but you may want to read about the 
   details: [Moving_WordPress](http://codex.wordpress.org/Moving_WordPress)
 *  Thread Starter [Parenthetical](https://wordpress.org/support/users/parenthetical/)
 * (@parenthetical)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702453)
 * Thanks! Unfortunately, though, I don’t have access to phpMyadmin (or even access
   to run mysql commands from the command line). Is there any other way to do it?
 *  Thread Starter [Parenthetical](https://wordpress.org/support/users/parenthetical/)
 * (@parenthetical)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702454)
 * Oh, I do have a .sql file that I backed up before I started doing any of this
   fiddling. Is there any way to use that, or do I need a .xml exported file?
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702456)
 * how did you get an .sql file if you dont have database access.. If you were able
   to export an sql, depending on how you got that, you ought to be able to import.
 * You mentioned moving to a new host; I dont know of a single decent host that 
   doesnt provide some sort of databsae access.
 *  Thread Starter [Parenthetical](https://wordpress.org/support/users/parenthetical/)
 * (@parenthetical)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702459)
 * Well, as I said, I’m currently hosting my site on my friend’s server. He backed
   up the database for me and gave me the file. More access for doing things like
   that without having to bug him is one reason I want to switch to a new host!
 * Is there anything I can do with the .sql file that I have, though?
 *  Thread Starter [Parenthetical](https://wordpress.org/support/users/parenthetical/)
 * (@parenthetical)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702467)
 * Never mind — turns out my friend has started a paid host, which will be much 
   more full-service and functional. So that solves that! 🙂
 * Thanks for your help, everyone.
 *  [wkessel](https://wordpress.org/support/users/wkessel/)
 * (@wkessel)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702869)
 * I have the same issue, but a much different set of results: I can’t export the
   WP XML file — I get the same errors. When I do a MySQL dump as per the instructions,
   I get either an export.php.html file — which does absolutely nothing, or I get
   a zip file. Safari or Firefox.
 * So far, so good, except: When I go to unzip the zip file, Stuffit chokes, so 
   I have to use the Mac archive utility. It unzips to a .sql.zip.cpgz file, which
   unzips to a sql.zip file, which unzips to a .sql.zip.cpgz file… ad infinitum.
   It’s no fun until you’ve covered your desktop with dozens of 10MB cloned zip 
   files… :-/
 * Terminal gunzip, Archive utility, and Stuffit are all useless. I’m stuck…

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Database error when exporting’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [export](https://wordpress.org/support/topic-tag/export/)
 * [upgrade](https://wordpress.org/support/topic-tag/upgrade/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [wkessel](https://wordpress.org/support/users/wkessel/)
 * Last activity: [18 years, 1 month ago](https://wordpress.org/support/topic/database-error-when-exporting/#post-702869)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
