XF 1.2 How to deal with IDs when importing

Moshe1010

Well-known member
When importing and keeping the IDs the same, does it matter what is initial username/email when installing a fresh install? If username ID1 is different from username ID1 in the imported content, how would that work?

Let's say I install a fresh 1.2 with a username ID1 as XFadmin. In my vB board, user ID 1 is Admin. Would Admin be user id number 1 after the import is complete? What would happen to XFadmin?

Thanks.
 

Brogan

XenForo moderator
Staff member
The importing section of the manual covers that: http://xenforo.com/help/importing/

XenForo does not permit the same name or email address to be used for more than one user, so you will be required to confirm what to do in the case of any affected users. The options available are to merge them or rename and change the email address.
 

AndyB

Well-known member
I suggest making sure there are no duplicate usernames or emails before importing.
 

PCC

Member
I just did a test import and made sure that the first admin account created for xenForo did not have the same username or email as user ID 1 in my old forum. It still merged the two accounts, I'm assuming because the user ID number was the same. Is there a way around this? I would like the original account I create for the xenForo install to remain, untied to any of the imported data.
 

AndyB

Well-known member
If you're importing from vB3 you can use this query to check for duplicate emails.

Code:
SELECT username, email
FROM user
WHERE email IN (SELECT email FROM user GROUP BY email HAVING ( COUNT( email ) > 1 ))
ORDER BY username ASC
 

PCC

Member
Thanks for the quick reply. I am importing into a new database. But you have to create an admin account when you do the xenForo install, right? So that admin user account is there and that user ID number is 1. When you import an existing vB4 database, there is already a user with ID number 1 in that database, so it merges the two accounts. Am I missing something here?
 

Jake Bunce

XenForo moderator
Staff member
Correct. If you enable the option to preserve the source ids during the import then it will merge userid 1 from both forums.

I wouldn't call this a problem. Just edit that user after the import to rename it. It will be like the original account was replaced with the imported one. And a new admin account can be created if needed.

Or you can disable the option to preserve the source ids when running the import. Then it will create new userids for all imported users.
 

AndyB

Well-known member
As Jake said, all sounds correct. Note it's much better to preserve IDs so be sure to select that option.
 

viper357

Active member
Note it's much better to preserve IDs so be sure to select that option.
Why is it better to preserve the userID's when importing, is it for SEO purposes?

I'm about to import a vb4 DB, it is a forum I have taken over from someone else, their userid is 1, whereas on the new xf my userid is 1, but I do not want to merge the two accounts as it will mess up our posts, I think. How do I import the vb4 database but make sure I remain as Super Admin?
 

viper357

Active member
Ok, so what will happen to userid 1 on the vb4 database after importing, will it not keep it as super admin?
importing content into an existing forum.
Just to be clear, it is a new forum I have set up, and about to import a vb4 db.
 
Top