- b2evolution CMS User Manual
- Back-office Reference
- System
- Maintenance
- Import
- WordPress XML Importer
WordPress XML Importer
This tool lets you import contents from an XML file. The format is compatible with WordPress exports.
Prerequisites (Export)
In order to import a WordPress blog into b2evolution, you must first:
- Export your WordPress database to an XML file by using WordPress’ export tool. Let’s assume your export file is named
wpblog.xml
. -
Your database does not include the media elements such as images, videos, PDFs, etc. that you uploaded to your WordPress blog. These are stored separately in one or more folders of your WordPress hosting space. You need to gather all such media files from the appropriate WordPress directory(ies) and save them in a folder, let’s call this folder
wpblog_files
(see below for other folder names that b2evolution will recognize).This folder should contain the subdirectories and contents of
wp-content/uploads
, i-e: all the images (PNG, GIF, JPG…) or videos (MPG, M4V…) or documents (DOC, PDF…) that you have uploaded and attached to your WordPress posts.
Note: these are the files you have uploaded to your blog, not the resources you have linked to on another site. If you one of your posts references an image on another site, you do not need to worry about that image. Optionally, you may make a ZIP file of
wpblog.xml
+wpblog_files
. This ZIP file could be calledwpblog.zip
.Note: You don’t have to make this ZIP file but it might make the upload process easier when you transfer your export to b2evolution’s import folder.
1. Upload your files to the import folder
You must upload your files into b2evolution’s /media/import
folder.
You can do this using your usual FTP client, by using b2evolution’s file manager, or even by clicking Upload/Manage import files on the screen shown above.
If you made a ZIP file, upload it into /media/import
.
If you didn’t make a ZIP file, make sure you upload both your wpblog.xml
and your wpblog_files
folder into /media/import
.
Note: accepted names for the "files" sub-folder are:
- Assuming the xml file is named
myexport.xml
:myexport
,myexport_files
,myexport_attachments
- Generic names are also accepted:
b2evolution_export_files
,export_files
,import_files
,files
,attachments
,uploads
,wp-content/uploads
(b2evo 7.0.2+).
2. Run the import tool
You should see a screen similar to the one depicted above. If you just uploaded your files and don’t see them, make sure to refresh the page.
You can see 3 different types of XML files listed:
- "Basic export (no attachments folder found)" : This means that b2evolution did not find any sub-folder containing attachments.
- "Complete export (attachments folder: xxx)" : This means that b2evolution did find a sub-folder containing attachments, as explained above.
- "Compressed Archive" : This means b2evolution found a ZIP archive that may or may not contain an appropriate XML file and attachments sub-folder. If you select such a ZIP file, b2evolution will attempt to decompress it into a sub-folder and use its contents.
To continue with the import process:
- Select the file you want to import.
- Select a Collection for import. New posts will be created in this collection. If you need a new collection, create it prior to launching the import tool.
- Select the Import mode
Replace: all the contents of the selected collection will be replaced by the contents of the imported file. This means that ALL the original content will be deleted (posts, comments, categories and tags).
WARNING: Be very careful with this option – it could cause severe data loss.- Append : all the contents of the imported XML file will be append to the existing contents of the destination collection. This allows to merge blogs. But this could also create many duplicates if you try the import process several times in a row.
- Click "Continue!"
3. Look at the results
The import process will run. If it encounters errors, especially missing image files, it will display those errors on screen. In such a case, it typically means you did not properly gather all your media files and/or did not upload them in a suitable location prior to running the import tool.
Technical notes
- Wordpress encodes posts as
<item>
s and also images or other attachments as<item>
s. - There are no clear links between posts and attachments.
- There is no clear definition of what is what and the importer needs to make a lot of guesses that cannot be based on explicit info from the file.
- In case of bad guesses from the importer, please screenshot how your attachments look like in wordpress and post it to the Support Forums.
What the importer imports:
Users (<wp:author>
)
<wp:author_id>
<wp:author_login>
<wp:author_email>
<wp:author_first_name>
<wp:author_last_name>
<evo:author_pass>
<evo:author_salt>
<evo:author_pass_driver>
<evo:author_group>
<evo:author_status>
<evo:author_nickname>
<evo:author_url>
<evo:author_level>
<evo:author_locale>
<evo:author_gender>
<evo:author_age_min>
<evo:author_age_max>
<evo:author_created_from_country>
<evo:author_country>
<evo:author_region>
<evo:author_subregion>
<evo:author_city>
<evo:author_source>
<evo:author_created_ts>
<evo:author_lastseen_ts>
<evo:author_created_from_ipv4>
<evo:author_profileupdate_date>
<evo:author_avatar_file_ID>
-
Profile pictures (
<evo:link>
)<evo:link_ID>
<evo:link_file_ID>
<evo:link_position>
<evo:link_order>
Categories (<wp:category>
)
<wp:category_nicename>
<wp:category_parent>
<wp:cat_name>
<wp:cat_description>
<wp:cat_order>
Tags (<wp:tag>
)
<wp:tag_name>
Items (<item>
)
<title>
<dc:creator>
- Author login. This field is used to set a post author user ID by provided author login. If author is not found in the imported<wp:author>
by<wp:author_login>
=<dc:creator>
then we find in b2evolution DB, otherwise we use ID of current User who is running the import.<content:encoded>
<excerpt:encoded>
<wp:post_id>
<wp:post_date>
<evo:post_date_mode>
<wp:comment_status>
<wp:status>
<wp:post_parent>
<wp:post_type>
<evo:post_lastedit_user>
- Author login. This field is used to set a post last edit user ID by provided login in the field. If author is not found in the imported<wp:author>
by<wp:author_login>
=<evo:post_lastedit_user>
then we find in b2evolution DB, otherwise we use user from<dc:creator>
by default.<evo:post_assigned_user>
- Author login. This field is used to set a post last edit user ID by provided login in the field. If author is not found in the imported<wp:author>
by<wp:author_login>
=<evo:post_assigned_user>
then we find in b2evolution DB, otherwise we do NOT set user for this field.<evo:post_datedeadline>
<evo:post_datemodified>
<evo:post_locale>
<evo:post_excerpt_autogenerated>
<evo:post_urltitle>
<evo:post_titletag>
<evo:post_url>
<evo:post_notifications_status>
<evo:post_renderers>
<evo:post_priority>
<evo:post_featured>
<evo:post_order>
<evo:post_country>
<evo:post_region>
<evo:post_subregion>
<evo:post_city>
<category domain="category" nicename="background">
<category domain="post_tag" nicename="demo">
-
Comments (
<wp:comment>
)<wp:comment_id>
<wp:comment_author>
<wp:comment_author_email>
<wp:comment_author_url>
<wp:comment_author_IP>
<wp:comment_date>
<wp:comment_content>
<wp:comment_approved>
<wp:comment_parent>
<wp:comment_user_id>
- Author ID. We find author user in<wp:author>
by<wp:author_id>
, if we cannot find user by wp author ID then such comment is imported as comment from anonymous user.<evo:comment_user_login>
- Author login. Use this first priority before<wp:comment_user_id>
to detect comment author user in order to don’t miss real authors when they exist in b2evo DB but no in imported XML file.<evo:comment_status>
<evo:comment_IP_country>
<evo:comment_rating>
<evo:comment_featured>
<evo:comment_author_url_nofollow>
<evo:comment_author_url_ugc>
<evo:comment_author_url_sponsored>
<evo:comment_helpful_addvotes>
<evo:comment_helpful_countvotes>
<evo:comment_spam_addvotes>
<evo:comment_spam_countvotes>
<evo:comment_karma>
<evo:comment_spam_karma>
<evo:comment_allow_msgform>
<evo:comment_notif_status>
-
Attachments (
<evo:link>
)<evo:link_ID>
<evo:link_file_ID>
<evo:link_position>
<evo:link_order>
Files (<file>
)
<evo:file_ID>
<evo:file_root_type>
<evo:file_root_ID>
<evo:file_path>
<evo:file_title>
<evo:file_alt>
<evo:file_desc>
<evo:zip_path>