Index: wp-admin/includes/export.php
===================================================================
--- wp-admin/includes/export.php	(revision 21059)
+++ wp-admin/includes/export.php	(working copy)
@@ -94,10 +94,15 @@
 
 		// put categories in order with no child going before its parent
 		while ( $cat = array_shift( $categories ) ) {
-			if ( $cat->parent == 0 || isset( $cats[$cat->parent] ) )
+			if ( $cat->parent == 0 || isset( $cats[$cat->parent] ) ) {
 				$cats[$cat->term_id] = $cat;
-			else
+			} elseif ( term_exists( (int) $cat->parent, 'category' ) ) {
+				// Assume we will find the parent later
 				$categories[] = $cat;
+			} else {
+				// For some reason the parent is missing
+				$cats[$cat->term_id] = $cat;
+			}
 		}
 
 		// put terms in order with no child going before its parent
