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

XF 1.3 Migrating a big forum from VB4 and redirecting the VBSEO links

dojo

Active member
#1
I am in the process of migrating a big forum from VB4 to Xenforo. Have done a test migration already and still have some questions before I attempt the official migration.

1. Is it possible to have the new xenforo powered forum in the same location as the VB4 forum and still have the proper redirects done? Right now I have the official forum on siteURL/forum/ and my test import is at siteURL/xf/. Since the client has worked for 8 years on the same directory, we'd like to keep the old place up and running, so the migration needs to be done on the /forum/ section.

2. How do I redirect the posts and categories? The threads work already by placing
Code:
RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ /threads/$1/? [R=301,L]
in the old .htaccess

Here is how the categories look like:
VB: siteURL/forum/refinance/
XF: siteURL/xf/forums/refinance.19/ (so I also get the id and don't know how to redirect it)

Posts
VB: siteURL/forum/harp-mortgage-loan-program/86979-need-refinance-modification.html#post504026
XF: siteURL/xf/threads/need-refinance-or-modification.86979/#post-504026

Thank you in advance for all the help
 

Mike

XenForo developer
Staff member
#2
1. If the redirect regex can be specified in such a way that they don't conflict with standard XF URLs, you can keep the install the same directory. Looking at your examples here, threads have ".html" so that will be ok. Your forum link uses the singular "forum" rather than "forums" so I don't think that will interfere.

2. If there's no ID in the old URL, there isn't really a simple way of automatically redirecting it. You would generally build the links manually: http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect

In terms of your post URLs, since the post identification is in an anchor, it is not sent to the server so there isn't a way to redirect to them specifically. You would end up at the correct thread though (and likely the correct page) from the thread redirects.
 

dojo

Active member
#3
Thank you, Mike, for the hints.

So ... the steps (hope am getting it right):
1. backup all the vb stuff
2. delete VB files, install xenforo.
3. run the import script
4. keep the old .htaccess (VB) in place and put the redirects.

Is this how I should do it?
 

Mike

XenForo developer
Staff member
#4
If your attachments are in files, you need to maintain those. You would also need the standard XF .htaccess. You should place the necessary redirects into it (before XF's redirects run).

Otherwise, that should work. You can do the import into a temporary location and then move the XF files when you're ready. (Old board needs to be closed during the import though.)
 

dojo

Active member
#6
Another question ...

I have done the migration, the threads work properly.
I will need to redirect some links from one form to another, but nothing I do seems to work.

What code should I use?
example: need to redirect register.php to register
a category like ../forum/citimortgage/ to ../forum/forums/citimortgage.47/

What I'm doing (probably wrong):
Code:
Redirect forum/register.php forum/register
Redirect forum/citimortgage/ forum/forums/citimortgage.47/
I have wordpress in the root .. could this cause the redirects not to work?
 

Mike

XenForo developer
Staff member
#7
Based on the docs, the path has to begin with a slash. That said, I'm not totally sure which htaccess you should put this in (the root or the one in XF's main directory). In the root, I'd try /forum/register.php for example. If that doesn't work, try both /forum/register.php and /register.php in the XF htaccess.
 
#8
So ... the steps (hope am getting it right):
1. backup all the vb stuff
2. delete VB files, install xenforo.
3. run the import script
4. keep the old .htaccess (VB) in place and put the redirects.

Is this how I should do it?
I would prefer this:

1. backup all the vb stuff
2. install xenforo in yourdomain.com/xenforo
3. run the import script
4. test the xenforo installation
5. rename yourdomain.com/forum => yourdomain.com/vbulletin
6. rename yourdomain.com/xenforo => yourdomain.com/forum
7. keep the old .htaccess (VB) in place and put the redirects

I would NOT delete the vB files, then you can check old/new installation if you get errors, wrong links, unreadable tables and so on ...
 

Jake Bunce

XenForo moderator
Staff member
#9
Another question ...

I have done the migration, the threads work properly.
I will need to redirect some links from one form to another, but nothing I do seems to work.

What code should I use?
example: need to redirect register.php to register
a category like ../forum/citimortgage/ to ../forum/forums/citimortgage.47/

What I'm doing (probably wrong):
Code:
Redirect forum/register.php forum/register
Redirect forum/citimortgage/ forum/forums/citimortgage.47/
I have wordpress in the root .. could this cause the redirects not to work?
Add these rules to the top of the .htaccess file in your /forum directory:

Code:
RewriteEngine On

RewriteRule ^register\.php$ /forum/register/ [R=301,L]
RewriteRule ^citimortgage/$ /forum/forums/citimortgage.47/ [R=301,L]
 

Jake Bunce

XenForo moderator
Staff member
#10
2. How do I redirect the posts and categories?

...

Here is how the categories look like:
VB: siteURL/forum/refinance/
XF: siteURL/xf/forums/refinance.19/ (so I also get the id and don't know how to redirect it)

Posts
VB: siteURL/forum/harp-mortgage-loan-program/86979-need-refinance-modification.html#post504026
XF: siteURL/xf/threads/need-refinance-or-modification.86979/#post-504026

Thank you in advance for all the help
That "post" URL cannot be redirected because the postid is in an anchor. The id must be before the # in the URL to be able to redirect it.

And there is already an example of a category redirect in my previous post.