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

XF 1.1 Retain imported content IDs?

Discussion in 'Installation, Upgrade, and Import Support' started by Thomas P, Nov 7, 2011.

  1. Thomas P

    Thomas P Member


    I am testing importing our site using the new 1.1b4 and just stumbled over the following feature on the "Import External Data" screen:
    This sounds nifty as the content IDs are seeding the URLs :)

    The function is new to b3 or 4 I assume as I didn't find anything about it on the support forums or the manual. Is there any downside or are there any caveats?
    For a one time import this should be the default option to go for, right?

  2. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, it's a fairly new addition to the importer.

    It's really up to you whether to use it or not.
    Personally I preferred to reset all IDs and have them sequential from 1 again.
  3. Thomas P

    Thomas P Member

    Just for cosmetic purposes, i.e. to start from scratch?
    I believe you would have gaps between the IDs when importing in contrast to have newly created linear IDs...

    To keep my old URLs using the retain-ids feature I could use something more simple than that?

    Regarding our size every simplification is crucial,
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, for that very reason.
    I imported from phpBB and due to a problem with the database a few years ago, the user IDs jumped from the hundreds to thousands, resulting in a huge gap of unused IDs.

    Hence why I was glad to be able to reset them all starting from 1.

    It's worth pointing out though that some need the IDs to be retained, due to external applications or software which make use of them.

    You will still need redirection of some sort, whether you retain the IDs or not.
    Thomas P likes this.
  5. Thomas P

    Thomas P Member

    Thanks Brogan
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Hmm. If you retain the IDs then you could actually get away with using regular expressions to pick out the IDs and redirect to the new URLs using the same IDs. It would be similar to what I did here:


    This kind of redirect doesn't require an import log or a custom script to access that log. It is pure htaccess. I will probably do this for my own import.
    Thomas P likes this.
  7. Thomas P

    Thomas P Member

    Perfect, so we just need to modify the default .htaccess to rewrite our old URLs.

    Thanks for the clarification
  8. Marcus

    Marcus Well-Known Member

    I so much wished I had waited for beta 4 to import my vb forum :( It took me hard work and my forum took a hit because of all the issues coming up after the import.

    Well - amazing the devs here listen to my request/feedback to retain ids. This retain id feature is not available anywhere else. This is a huge selling point.
    Jarod likes this.
  9. Ellie

    Ellie Member

    I am about to do a test import on our test forum, it has posts etc from my test users.

    Is it worth starting again to retain the ID's? I'm not clear on the advantages of keeping the old ID's if we need to use the redirect script regardless.
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The PHP redirect scripts are only required if you do not preserve the ids. If you do preserve the ids then you can get away with just using rewrite rules for the redirects (though the PHP redirects will work too). Either method is acceptable.

Share This Page