Marcus
Well-known member
If you import from another forum software to an empty xenforo, it can be useful to have your former IDs. Notice: This thread is for discussing this. There are two ways: The elegant one where everything is done in the importer. I'll go the non-elegant route: Create fake data in the old installation that will be imported from xenforo.
1 Identify the IDs that are important for you. For my vb board these are: userid, postid, threadid, forumid.
2 Create rangeid table
a) create a table "rangeid" with the fields "id" (auto-increment, primary) and "anyid".
b) auto-fill this table with IDs: "INSERT INTO rangeid (anyid) SELECT postid AS anyid FROM post" and let this query run multiple times
3) Input fake data into the tables (forum, thread,user,post)
a) Remove autoincrement and then the primary index from the table you put fake data in
b) Insert the missing IDs with fake data. Example for userids on vbulletin installation:
This query takes a long time so any advice to rewrite it will be very welcome.
-> now repeat step 3 and d for all other IDs, change the fake data accordingly.
4 Import as usual from xf admin center.
5 Remove fake ids Example for userid
- repeat this step for all other IDs
1 Identify the IDs that are important for you. For my vb board these are: userid, postid, threadid, forumid.
2 Create rangeid table
a) create a table "rangeid" with the fields "id" (auto-increment, primary) and "anyid".
b) auto-fill this table with IDs: "INSERT INTO rangeid (anyid) SELECT postid AS anyid FROM post" and let this query run multiple times
3) Input fake data into the tables (forum, thread,user,post)
a) Remove autoincrement and then the primary index from the table you put fake data in
b) Insert the missing IDs with fake data. Example for userids on vbulletin installation:
Code:
INSERT INTO user (userid,username, email)
SELECT id AS userid, CONCAT( rand( ) , "removeuser" ) AS username, CONCAT( rand( ) , "removeuser@mail.com" ) AS email
FROM rangeid
LEFT JOIN user ON user.userid = rangeid.id
-> now repeat step 3 and d for all other IDs, change the fake data accordingly.
4 Import as usual from xf admin center.
5 Remove fake ids Example for userid
Code:
DELETE FROM user WHERE username = "removed later"