XF 1.1 Importing Wordpress into Xenforo

akia

Well-known member
Has anyone got any ideas of how best to import my wordpress site into Xenforo.

I just want my posts to go into my forum as threads.

I've tried using Vb impex as a go between but not having any luck with that as its not been updated to the new wordpress.

So now I'm stuck, and I don't want to have to do a copy and paste job. So any suggestions welcome!
 
So I was confused why the query cannot find thread table in my database... and then I create a test post inside a test forum and voila! :)

Took me almost 3 hours to solve this problem. :rofl:
 
Hi!
How to correct Vietnamese with UTF-8 encode?
origin
Hội nghị lần thứ 23 các nước thành viên Công ước của Liên hợp quốc về Luật Biển (UNCLOS) năm 1982 đã được tổ chức từ ngày 10 đến 14/6 tại trụ sở chính của Liên hợp quốc ở New York Mỹ.
Result:
H?i ngh? l?n th? 23 các n??c thành viên Công ??c c?a Liên h?p qu?c v? Lu?t Bi?n (UNCLOS) n?m 1982 ?ã ???c t? ch?c t? ngày 10 ??n 14/6 t?i tr? s? chính c?a Liên h?p qu?c ? New York M?.

?ây là d?p ?? các n??c thành viên ?i?m l?i ho?t ??ng c?a các c? quan ???c thành l?p theo quy ??nh c?a công ??c trên, bao g?m Tòa án qu?c t? v? Lu?t Bi?n, C? quan Quy?n l?c qu?c t? v? ?áy ??i d??ng và ?y ban Ranh gi?i th?m l?c ??a c?a Liên h?p qu?c.
And how to copy tables from the Wordpress database to the vB database please?
Thank for your support,
 
Last edited:
Hmm...I'm trying to import a Wordpress blog into XF via the vbulletin 4 route. However, trying to run Impex in vb4.2.6 I get the following error:
mysql error: Invalid SQL: CREATE TABLE impexerror (
errorid bigint(20) unsigned NOT NULL auto_increment,
errortype varchar(10) NOT NULL default '',
classnumber varchar(3) NOT NULL default '',
importid bigint(20) NOT NULL default 0,
error varchar(250) default 'NULL',
remedy varchar(250) default 'NULL',
PRIMARY KEY (errorid)
) TYPE=MyISAM

I'll put in a request for the WP importer, to see if that helps with the development of one. :)
 
Sorry for bumping this thread up.

I have a running wordpress blog (niche: design) that have thousands of visitors daily. Given the fact that I do not have time to update it regularly, I decide to want to turn it up to Xenforo forum.

But I am really newbie in import thing. If I purchase the license for this particular domain, would someone from xenforo help me please to get the job done? Turn the wordpress articles (posts) into threads? So that we will not lose the google index.

Is that possible @Jake Bunce ?

My wordpress site just has around 500 posts.

Thank you in advance.
 
Sorry for bumping this thread up.

I have a running wordpress blog (niche: design) that have thousands of visitors daily. Given the fact that I do not have time to update it regularly, I decide to want to turn it up to Xenforo forum.

But I am really newbie in import thing. If I purchase the license for this particular domain, would someone from xenforo help me please to get the job done? Turn the wordpress articles (posts) into threads? So that we will not lose the google index.

Is that possible @Jake Bunce ?

My wordpress site just has around 500 posts.

Thank you in advance.

If it's just WP articles then I can do it with some direct queries. I would be able to create a thread for each article with the first (and only) post in the thread being the content of the article.

I would need phpmyadmin access to both databases and admin access to XF.
 
If it's just WP articles then I can do it with some direct queries. I would be able to create a thread for each article with the first (and only) post in the thread being the content of the article.

I would need phpmyadmin access to both databases and admin access to XF.
Jake I just made a new thread regarding this:
https://xenforo.com/community/threads/want-to-turn-wordpress-posts-into-threads-in-my-forum.116008/

Is that offer still standing? The one where I send you both of the phpmyadmin login? Yes, just the wordpress articles (posts) turn into new threads in a specified forum (as explained above). However this is not an empty forum. The forum already has the content itself. Just need some additional content from a high traffic wordpress site and once new threads added I would like to redirect each single wordpress post URL to the new XF thread URL. Is it possible? If so yes I am a lot more than happy to provide you my phpmyadmin access.

Thank you for your help.
 
Jake I just made a new thread regarding this:
https://xenforo.com/community/threads/want-to-turn-wordpress-posts-into-threads-in-my-forum.116008/

Is that offer still standing? The one where I send you both of the phpmyadmin login? Yes, just the wordpress articles (posts) turn into new threads in a specified forum (as explained above). However this is not an empty forum. The forum already has the content itself. Just need some additional content from a high traffic wordpress site and once new threads added I would like to redirect each single wordpress post URL to the new XF thread URL. Is it possible? If so yes I am a lot more than happy to provide you my phpmyadmin access.

Thank you for your help.

Yes the offer is still open.

With a populated destination db I would briefly turn off XenForo and then insert the WP content into an id range to avoid collisions with existing content. For example, if your current highest threadid is 15500 then I would reserve 16000-16999 for your WP articles. The defined range avoids collisions and allows for calculated redirects.
 
Yes the offer is still open.

With a populated destination db I would briefly turn off XenForo and then insert the WP content into an id range to avoid collisions with existing content. For example, if your current highest threadid is 15500 then I would reserve 16000-16999 for your WP articles. The defined range avoids collisions and allows for calculated redirects.
So what do you need other than cpanel and phpmyadmin password?

Also how long will our xenforo board be turned off?

After importing the database, how could I redirect every single post imported, so once people visit the wordpress url, it will be redirected to the new one (xenforo new thread)?
 
So what do you need other than cpanel and phpmyadmin password?

Also how long will our xenforo board be turned off?

After importing the database, how could I redirect every single post imported, so once people visit the wordpress url, it will be redirected to the new one (xenforo new thread)?

I should have XF admin access as well so I can turn on and off the forum.

Downtime should only be a minute.

I can setup redirect rules in the .htaccess file using CPanel access.
 
Yes the offer is still open.

With a populated destination db I would briefly turn off XenForo and then insert the WP content into an id range to avoid collisions with existing content. For example, if your current highest threadid is 15500 then I would reserve 16000-16999 for your WP articles. The defined range avoids collisions and allows for calculated redirects.


Hi Jake,

I'm thinking to move all my wordpress articles to xenforo, 1 thread for each article. There are 150 articles, with clickable picture inside text.
I'm trying to figure out how to create new thread in xenforo in a consistent way. What are the tables need to be written ? Also, about the above quoted part, what if if after some time the threadid reach the interval you reserved for WP articles ?
 
Hi Jake,

I'm thinking to move all my wordpress articles to xenforo, 1 thread for each article. There are 150 articles, with clickable picture inside text.
I'm trying to figure out how to create new thread in xenforo in a consistent way. What are the tables need to be written ? Also, about the above quoted part, what if if after some time the threadid reach the interval you reserved for WP articles ?

The tables are xf_post and xf_thread.

The id reservation sets the autoincrement value to be higher than the WP ids so there is no collision.

Note that posting codes need manual cleaning using the post replacement tool:

https://xenforo.com/community/resources/post-content-find-replace.1549/

This requires regex ability.
 
Ignore my old post with vB instructions. Here are queries to move the data directly from Wordpress into XenForo. First copy the relevant Wordpress tables into your XenForo database using phpmyadmin. Then run these queries to copy the posts and comments into XenForo as threads and posts. There are a few hard-coded values including (and in order):

1) The next available thread_id on your forum.

2) The next available post_id on your forum.

3) The destination node_id on your forum.

4) The user_id of the user in XenForo to which the imported threads will be attributed.

You may also need to update the Wordpress table names to use your prefix.

Rich (BB code):
CREATE TABLE IF NOT EXISTS `wp_post_ids` (
  `ID` int(11) NOT NULL,
  `post_id` int(11) NOT NULL AUTO_INCREMENT,
  `comment` int(11) NOT NULL,
  PRIMARY KEY (`post_id`),
  UNIQUE KEY `ID` (`ID`,`comment`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `wp_thread_ids` (
  `ID` int(11) NOT NULL,
  `thread_id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`thread_id`),
  UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

TRUNCATE TABLE wp_thread_ids;
ALTER TABLE wp_thread_ids AUTO_INCREMENT = 6469;

TRUNCATE TABLE wp_post_ids;
ALTER TABLE wp_post_ids AUTO_INCREMENT = 65933;

INSERT INTO wp_thread_ids
(
	ID
)
SELECT
	ID
FROM wpng_posts
WHERE post_type = 'post';

INSERT INTO wp_post_ids
(
	ID,
	comment
)
SELECT
	ID,
	0 AS 'comment'
FROM wpng_posts
WHERE post_type = 'post';

INSERT INTO wp_post_ids
(
	ID,
	comment
)
SELECT
	comment_ID AS 'ID',
	1 AS 'comment'
FROM wpng_comments;



-- threads
INSERT INTO xf_thread (thread_id, node_id, title, reply_count, view_count, user_id, username, post_date, sticky, discussion_state, discussion_open, discussion_type, first_post_id, first_post_likes, last_post_date, last_post_id, last_post_user_id, last_post_username, prefix_id)
	SELECT wpt.thread_id, 120, wpp.post_title, 0, 0, 4267, COALESCE(u.user_login,'UNKNOWN USER'), UNIX_TIMESTAMP(post_date), 0, 'visible', 1, '', 0, 0, 0, 0, 0, '', 0
	FROM wpng_posts AS wpp
	INNER JOIN wp_thread_ids wpt ON (wpt.ID = wpp.ID)
	LEFT JOIN wpng_users AS u ON (u.ID = wpp.post_author)
	WHERE wpp.post_type = 'post'
ON DUPLICATE KEY UPDATE
	thread_id = VALUES(thread_id);


-- first posts in threads
INSERT INTO xf_post (post_id, thread_id, user_id, username, post_date, message, ip_id, message_state, attach_count, position, likes, like_users, warning_id, warning_message, last_edit_date, last_edit_user_id, edit_count)
	SELECT wpst.post_id, wpt.thread_id, 4267, COALESCE(u.user_login,'UNKNOWN USER'), UNIX_TIMESTAMP(post_date), wpp.post_content, 0, 'visible', 0, 1, 0, 'a:0:{}', 0, '', 0, 0, 0
	FROM wpng_posts AS wpp
	INNER JOIN wp_thread_ids wpt ON (wpt.ID = wpp.ID)
	INNER JOIN wp_post_ids wpst ON (wpst.ID = wpp.ID AND wpst.comment = 0)
	LEFT JOIN wpng_users AS u ON (u.ID = wpp.post_author)
	WHERE wpp.post_type = 'post'
ON DUPLICATE KEY UPDATE
	message = VALUES(message);


-- other posts in threads
INSERT INTO xf_post (post_id, thread_id, user_id, username, post_date, message, ip_id, message_state, attach_count, position, likes, like_users, warning_id, warning_message, last_edit_date, last_edit_user_id, edit_count)
	SELECT wpst.post_id, wpt.thread_id, 0, wpc.comment_author, UNIX_TIMESTAMP(comment_date), comment_content, 0, 'visible', 0, 2, 0, 'a:0:{}', 0, '', 0, 0, 0
	FROM wpng_comments AS wpc
	INNER JOIN wp_thread_ids wpt ON (wpt.ID = wpc.comment_post_ID)
	INNER JOIN wp_post_ids wpst ON (wpst.ID = wpc.comment_ID AND wpst.comment = 1)
ON DUPLICATE KEY UPDATE
	message = VALUES(message);

After running these queries you need to login to your XenForo Admin CP and rebuild the thread and forum information:

Admin CP -> Tools -> Rebuild Caches

You will very likely see raw HTML in the imported posts. You will need to use the regex replacement tool to clean this up. It's tedious:

https://xenforo.com/community/resources/post-content-find-replace.1549/

If you are uncomfortable with SQL and/or regex then it may be best to hire some one to do this for you.
 
Hi @Jake Bunce

I have some 30k+ blog posts from one wordpress site that I'd like to import to my xenforo ..

Wordpress has been increasingly taxing in terms of maintainence. I find xenforo easier that way.

Will you be so kind to help me out with it?
 
Top Bottom