• 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?

#1
Hello,

I am testing importing our site using the new 1.1b4 and just stumbled over the following feature on the "Import External Data" screen:
Retain imported content IDs
If you are importing into a new installation with no existing data, you can retain the existing IDs for imported users, forums, threads etc., so that thread 345 from your import source will map to thread 345 in your XenForo database. If you have existing XenForo data, this will fail.
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?

Thanks,
Tom
 

Brogan

XenForo moderator
Staff member
#2
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.
 

Brogan

XenForo moderator
Staff member
#4
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...
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.
 

Jake Bunce

XenForo moderator
Staff member
#6
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:

http://xenforo.com/community/thread...nforo-htaccess-for-own-use.17168/#post-225391

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.
 

Marcus

Well-known member
#8
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.
 
#9
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.
 

Jake Bunce

XenForo moderator
Staff member
#10
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.
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.