Resource icon

bbPress Importer 1.0.0

No permission to download

shabbirbhimani

Active member
shabbirbhimani submitted a new resource:

bbPress Importer - Set of SQL Queries to import Data from bbPress over to xenForo

NOTE: This has been tested to work on a blank xenForo forum only.

I have attached the SQL script that imports the data from bbPress into Xenforo. I could not find any script to import bbPress 2.5+ data into xenForo and even tried bbPress to phpBB to xenForo but those 2 step process had their own issues.

So I created SQL script based on the bbPress to phpBB importer by iamsteadman on github. It imports...
Read more about this resource...
 

FancyFloyd

New member
How does this actually work? Where do I run it -- directly in the db as a sql command?

If that's how, I take it, it only works if both BBpress and XF are both on the same server?

Sorry for the noob questions.

EDIT: OK figured it out. Word to the wise, take note of Chris below.
 
Last edited:

Chris D

XenForo developer
Staff member
It has been identified that this importer does work, but it may leave some missing records which may affect certain features in XF, such as editing users.

It is recommended that after importing you should additionally run these queries to cover any possible missing records:
SQL:
INSERT IGNORE INTO xf_user_option (user_id) SELECT user_id FROM xf_user;
INSERT IGNORE INTO xf_user_privacy (user_id) SELECT user_id FROM xf_user;
INSERT IGNORE INTO xf_user_profile (user_id) SELECT user_id FROM xf_user;
INSERT IGNORE INTO xf_user_authenticate (user_id) SELECT user_id FROM xf_user;
 

mmirlach

Active member
How does this actually work? Where do I run it -- directly in the db as a sql command?

If that's how, I take it, it only works if both BBpress and XF are both on the same server?

Sorry for the noob questions.

EDIT: OK figured it out. Word to the wise, take note of Chris below.
same noob question from my end: I do understand that I need to run the script in the db as a sql command but how do I connect from the xf database to the wp database?
or do I just need to add both databases to the same database user? (right now it's two databases on the same server but with different database users)
 

djbaxter

Well-known member
Also having a problem figuring out how to run this.

I ran the (edited) SQL script in the Xenforo database and got this error:

Code:
INSERT INTO
    xf_user (
        user_id,
        username,
    email,
        user_group_id,
    register_date,
    last_activity
    )
SELECT
    ID + @user_id_jump /* New ID */,
    LOWER(REPLACE(user_login, '.', '_')) /* Sanitised username */,
    user_email /* Email address */,
    2 /* Group ("Registered") */,
    UNIX_TIMESTAMP(user_registered) /* Date the user signed up */,
    UNIX_TIMESTAMP(user_registered) /* Date of the user's last activity */
FROM
    wpgc_users
WHERE
ID > 1

MySQL said: Documentation
#1146 - Table 'certif64_xenforo.wpgc_users' doesn't exist
... which is of course correct. The BBPress forum is resident in the WordPress database which has a different name, so all the FROM lines should be referencing

Code:
certif64_wp222.wpgc_users
but where/how to specify this? Do I need to change the "prefix" to

Code:
certif64_wp222.wpgc_
 

Chris D

XenForo developer
Staff member
Yep, this would probably work:
SQL:
INSERT INTO
    xf_user (
        user_id,
        username,
    email,
        user_group_id,
    register_date,
    last_activity
    )
SELECT
    ID + @user_id_jump /* New ID */,
    LOWER(REPLACE(user_login, '.', '_')) /* Sanitised username */,
    user_email /* Email address */,
    2 /* Group ("Registered") */,
    UNIX_TIMESTAMP(user_registered) /* Date the user signed up */,
    UNIX_TIMESTAMP(user_registered) /* Date of the user's last activity */
FROM
    certif64_wp222.wpgc_users
WHERE
ID > 1
Please make sure you run the query in this post after the import is complete:
 

djbaxter

Well-known member
@Chris D

However, running your additional query above, I get this:

Code:
0 rows inserted. (Query took 0.0028 seconds.)
INSERT IGNORE INTO xf_user_option (user_id) SELECT user_id FROM xf_user
0 rows inserted. (Query took 0.0028 seconds.)
INSERT IGNORE INTO xf_user_option (user_id) SELECT user_id FROM xf_user
0 rows inserted. (Query took 0.0032 seconds.)
INSERT IGNORE INTO xf_user_privacy (user_id) SELECT user_id FROM xf_user
0 rows inserted. (Query took 0.0032 seconds.)
INSERT IGNORE INTO xf_user_profile (user_id) SELECT user_id FROM xf_user
0 rows inserted. (Query took 0.0030 seconds.)
INSERT IGNORE INTO xf_user_authenticate (user_id) SELECT user_id FROM xf_user
0 rows inserted. (Query took 0.0032 seconds.)
INSERT IGNORE INTO xf_user_privacy (user_id) SELECT user_id FROM xf_user
0 rows inserted. (Query took 0.0032 seconds.)
INSERT IGNORE INTO xf_user_profile (user_id) SELECT user_id FROM xf_user
0 rows inserted. (Query took 0.0030 seconds.)
INSERT IGNORE INTO xf_user_authenticate (user_id) SELECT user_id FROM xf_user
I'm not sure what to make of that. Am I okay or do I need to take additional action?
 

Chris D

XenForo developer
Staff member
That's kind of unexpected. This BB Press importer only seems to create the xf_user records (as far as I can remember).

Could you check to make sure the BB Press importer actually inserted records into xf_user?

If it did, can you check to make sure there is a roughly equal number of records in all of the above tables?
 

Chris D

XenForo developer
Staff member
Well, I've just read the query from the importer and it does seem like most bases are covered. Except:
SQL:
INSERT IGNORE INTO xf_user_profile (user_id) SELECT user_id FROM xf_user;
I'd have expected that to insert some records because that isn't included in the importer.
 

Chris D

XenForo developer
Staff member
All good then.

I suspect that the insert queries did actually work at some point but maybe you missed the output amongst all of the other 0 rows inserted ones, or something like that. Either way, as long as they are approximately the correct number, there shouldn't be any issues.
 
Top