1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Redirection Scripts for vBulletin 3.x

Discussion in 'Add-on Releases [Archive]' started by Kier, Oct 6, 2010.

Thread Status:
Not open for further replies.
  1. Kier

    Kier XenForo Developer Staff Member

    If you have imported your vBulletin 3.x database into XenForo, you can automatically redirect all traffic destined for your vBulletin content to its new location within XenForo.

    All you need to do is unzip these files and place them in the directory within which the vBulletin files with the corresponding names would be located.

    Any requests for the old URLs will be redirected with a 301 permanent redirection header.

    Version 2 - December 9th 2010

    The original version of this system required that XenForo be installed into the same directory that vBulletin was installed.

    Version 2, now attached to this post, allows you to specify a different directory in which XenForo is installed.

    To do this, simply edit the included 301config.php file, un-comment the $fileDir = '/some/path/here' line and then replace the value for $fileDir with the full path to your XenForo installation, for example:
    $fileDir '/home/example/public_html/xenforo-forum';
    Note that the 301config.php, showthread.php, forumdisplay.php and showpost.php files must still be placed in the directory in which vBulletin was installed for this to work.

    Version 4 - March 29th 2011

    This new version includes a rewriting system for printthread.php, attachment.php and the vBulletin 3 'search-engine-friendly' archive system. Simply overwrite your existing files, except 301config.php, which has not changed, and include the new archive/index.php file.

    Version 5 - April 6th 2011

    This new version includes the system described in the XenForo 1.0.1 Release Announcement whereby XenForo may support multiple import sources.

    Full details of how to make use of the system are in the XenForo manual.

    Version 6 - April 11th 2011

    This new version now supports redirection for member profile pages.

    Attached Files:

  2. Mythotical

    Mythotical Well-Known Member

    Great job Kier
  3. Vicros

    Vicros Active Member

    Yes, great work Kier,
  4. Trent Gillespie

    Trent Gillespie Active Member

    Just finished importing 320k of posts to xF and this is exactly what I was looking for. Thank you.

    Now it's time to patiently wait for an RC.
  5. Rodrigo Farcas

    Rodrigo Farcas Active Member

    How does this work with VBSEO'ed URL's?

  6. SchmitzIT

    SchmitzIT Well-Known Member

    Any ideas when something similar for vB 4.* will arrive? I have one site that just is a forum, and it'd be perfect to instantly get over to XF so I can sell off the vB license for it and buy more XF licenses :D
  7. PompeyScot

    PompeyScot Member

    How long did that take you out of interest Trent? I'll have just shy of 800,000 posts to import, so just want to get some sort of guide as to how much time and resource it will take.
  8. dmnkhhn

    dmnkhhn Active Member

  9. Booth

    Booth Well-Known Member

    Brilliant, works perfectly with standard vb url's :)
  10. Trent Gillespie

    Trent Gillespie Active Member

    Near 45 minutes. I had to manually refresh the import page a few times, so maybe a little less actually. It did a swell job too.
  11. brendanc

    brendanc Active Member

    I hate to poo poo on the parade, but this doesn't really help with imported content unless you've never deleted a single post/thread from your forums.

    The way the importing works, all the thread and post ids will mismatch... so it's going to 301 redir to the wrong content. That would be disastrous to SEO.

    Example: you have 3 posts with ids of 1,2,3,4. Let's say you delete the post with id 2. Then you import your posts into XF.

    Mapping: XF ID = Old ID

    1 = 1
    2 = 3
    3 = 4

    Lets say google cached a link to the post with id of 3 when you had your old forums. It's now going to redirect to the content of whatever ID XF gave it when it was importing... it could be off by 1 or 5 or 10 or whatever. Every deleted post in your old forums increases the difference as you go up in #.
  12. Mike

    Mike XenForo Developer Staff Member

    Err, the scripts resolve old IDs to new IDs.
    HydraulicJack and brendanc like this.
  13. brendanc

    brendanc Active Member

    Ah. I didn't see the xf_import_log table. Disregard my post. Armed with this new knowledge, I am off to create a script that fixes the post references in quotes.
  14. Andy.N

    Andy.N Well-Known Member

    can anyone explain where to put these files?
    I see .svn and vb folder

    My old VB structure is site.com/forum/
    and new xf set up is newsite.com/forum/
  15. DavidB

    DavidB Member

    Good stuff, I was just looking for this.

    Ill try it tonight and let you know how it goes!
  16. jonsidneyb

    jonsidneyb Well-Known Member

    This is great. When one is available for vB4 I will be thrilled to death.
  17. BigSoccer Tech

    BigSoccer Tech Active Member

    Works great. Question. I have my old vb at /forum and my xen at /community. It was redirecting properly but kept ending up at /forum so the URL was wrong. So we did this:

    Really, that function call should pull up the board url set in the admin

    My guru I replaced this line:
    $response->setRedirect(XenForo_Link::convertUriToAbsoluteUri($target), 301);

    with this:
    $response->setRedirect(XenForo_Application::get('options')->boardUrl.'/'.$target, 301);

    That would let you even move to a new domain.
    kkm323, Dan and Jake Bunce like this.
  18. jacko

    jacko Well-Known Member

    Do I understand correctly that Xenforo stores the old vBulletin IDs in the database?
    OR does Xenforo keeps the same number IDs for forums, threads and posts?
  19. mikoo

    mikoo Active Member

    ... anyone who can give a simple answer to this probably simple question? I am afraid I canĀ“t. :rolleyes:
  20. Mike

    Mike XenForo Developer Staff Member

    It stores the old IDs and maps.

    The script is not designed for redirecting to another URL, though we could change it to that. It's designed to sit in place of the respective files (showthread.php, etc).

    I've removed the .svn dir as that wasn't supposed to be there.
Thread Status:
Not open for further replies.

Share This Page