1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 How to deal with IDs when importing

Discussion in 'Installation, Upgrade, and Import Support' started by Moshe1010, Jul 31, 2013.

  1. Moshe1010

    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.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The importing section of the manual covers that: http://xenforo.com/help/importing/

     
  3. AndyB

    AndyB Well-Known Member

    I suggest making sure there are no duplicate usernames or emails before importing.
     
  4. PCC

    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.
     
  5. AndyB

    AndyB Well-Known Member

    It's unclear what you are wanting to do or have done.

    You should be importing into a new database.
     
  6. AndyB

    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
    
     
  7. PCC

    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?
     
  8. Jake Bunce

    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.
     
  9. AndyB

    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.
     
  10. PCC

    PCC Member

    Thanks. I just wanted to make sure I wasn't doing something wrong.
     
  11. viper357

    viper357 Active Member

    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?
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    You can't preserve IDs when importing content into an existing forum.
     
  13. viper357

    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?
    Just to be clear, it is a new forum I have set up, and about to import a vb4 db.
     
  14. Brogan

    Brogan XenForo Moderator Staff Member

    If it is a new forum user id 1 will be merged.
     
  15. viper357

    viper357 Active Member

    Ok, thanks.
     

Share This Page