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...
 
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:
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;
 
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)
 
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_
 
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:
 
@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?
 
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?
 
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.
 
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.
 
Hi,

I try to do this import for a friend right now. I installed a fresh and clean XF 1.5.24 version and imported the wordpress DB diectly into it. So both are in the dame DB right now. XF with the usual prefixes and Wordpress also with the standard wp_ prefix.

I changed the prefix in the import SQL script accordingly and although some weired errors appeared in phpmyadmin, it seems to work.

I rebuild all caches as recommended in the overview and I also added a testforum so that finally the imported forus and threads apperad also in the in front-end.

Now check everything in detail. Number of users is correct. Number of postings I still have to verify with my friend.

So far so good.

The first problem: The images within the postings do not show up. I see at that spot the following code:

Code:
<img class="alignright" src="https://mydomainname.com/wp-content/uploads/hm_bbpui/33548/oz9poomifjx5k0as4stzr4l0p60ewrpa.png" alt="Skins" width="667" height="499" />

It seems that it is not enough to have only the DB for this import. It seems trhat the images from Wordpress are all from the WP upload folder. So I think I need all files from the WP upload folder too? Is this correct?
 
2 other issues after the import:

1. Formatting seems to be wrong. This shwos up within the posting, if a users used align left etc.

Code:
&lt;p style="text-align: left;"&gt;die von Dir angegebenen Schritte habe ich gemacht.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;Beim Schritt 2. gebe ich das Datum ein 01.04.1776,&lt;/p&gt;
&lt;p style="text-align: left;"&gt;dann "Enter" drücken und es kommt wieder die Fehlermeldung “Der Index der Liste überschreitet das Maximum (3)" .&lt;/p&gt;

2. Userprofile.

If a users posted already different postings, it is shown under his Avatar. For example he posted already 19 times. But in his userprofile, no postings show up.

What could be the reason for this?
 
Back
Top Bottom