Resource icon

Redirection Scripts for Invision Power Board 3.x 4.0

No permission to download
Unless I missed it, not sure how I could, there is no HTACCESS file in the zip.

"All that is required is that you unzip these files and place them in the directory in which your IPB files resided. The included .htaccess file will take care of redirecting calls to IPB into to the ips2xf.php file, which will in turn redirect traffic to the appropriate traffic to XenForo."

Just finishing conversion and surely need things to redirect.

Thanks
 
There is a .htaccess file included. You may need to make sure you can view "hidden" files to see it.
 
Thanks. Might I suggest doing like the other htaccess files xenfono has and not using the dot if there is one. ;) It does not work well for MacUsers are all dot files are hidden.

:)

Thank you Mike. I will need to see if I can get it to show.
 
Having some issues getting this to work and not sure why!

- IPB 3.x was installed to http://forum.domain.com
- XF is installed to the same location (http://forum.domain.com)
- 301config.php edited to contain the following: define('IMPORT_LOG_TABLE', 'archived_import_log'); (this table is correct), $fileDir remains commented as it wasn't changed
- The .htaccess, 301config.php and ips2xf.php uploaded to http://forum.domain.com
- IPB 3.x link: http://forum.domain.com/topic/123-topic-name/
- XF link: http://forum.domain.com/threads/topic-name.123/

When accessing the IPB 3.x link, I get a 301 redirect to http://forum.domain.com only. Web server is handled by ServerPilot.io.

Am I missing something? :(
 
This generally indicates the entry couldn't be found in the import log, so it's worth double checking that. If unsure, paste the contents of your 301config.php file here.
 
My issue seems to have resolved itself. I think it may have been some kind of caching, either with XF, CloudFlare or our web server mix (nginx/Apache). Thank you anyway - all working now :)
 
If unsure, paste the contents of your 301config.php file here.

Hello. And as to me to be. I have an ipb forum on the site1 site I want to transfer to xenforo which on the site2 site I need on the old domain to redirect to a new one,
Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} ^site1.com [NC]
RewriteRule ^(.*)$ http://site2/$1 [L,R=301]

And in xeforo install the files with the redirect of the new url?

According to the instructions for the new url

Will there be two redirects from the old domain to the new one and to xenforo?
 
EDIT: Figured it out - all good. i was using 1.5 script with 2.0 installation.


I'll borrow the format of @Djovik as our issue is similar :)


- IPB 3.x was installed to http://forum.domain.com
- XF is installed to the same location (http://forum.domain.com)
- 301config.php edited to contain the following: define('IMPORT_LOG_TABLE', 'archived_import_log'); (this table is correct), $fileDir is pointing to the correct directory where xf files sit.
- edited nginx configuration as follows :

Code:
      location / {
            index index.php index.html index.htm;
        #    try_files $uri $uri/ /index.php?$uri&$args;

            if ($uri ~* /(topic|forum|user)/) {
                rewrite ^ /ips2xf.php? last;
            }

            if ($args ~* (^|&)show(topic|forum|user)=) {
                rewrite ^ /ips2xf.php? last;
            }

            if ($args ~* ^/(topic|forum|user)/) {
                rewrite ^ /ips2xf.php? last;
            }
                try_files $uri $uri/ /index.php?$uri&$args;

        }

301config.php contents:
Code:
<?php

/* ----------------------------------------------------------- *\
This variable defines where XenForo is installed.

If you have not installed XenForo into the same directory in which
IP.board was installed, you will need to provide the full path to
the XenForo directory here. Remove the leading // and then enter
the path as in the following examples:
#
#       $fileDir = '/home/example/public_html/new_forums';
#
#       $fileDir = 'C:/inetpub/wwwroot/xenforo';
#
\* ----------------------------------------------------------- */

        $fileDir = '/usr/share/nginx/html/xf-a3clube';

/* ----------------------------------------------------------- *\
This constant defines the table from which the import redirection
scripts will fetch their data. Normally they will use the table
'xf_import_log', but if you have archived your import data, you
should provide the name of the archive table here. Remove the
leading // and then replace 'import_log_x' with the name of your
archive table, as in the following examples:
#
#       define('IMPORT_LOG_TABLE', 'my_import_log');
#
#       define('IMPORT_LOG_TABLE', 'import_log_my_forums');
#
\* ----------------------------------------------------------- */

//      define('IMPORT_LOG_TABLE', 'import_log_x');
define('IMPORT_LOG_TABLE', 'archived_import_log');

- IPB 3.x link: https://a3clube.com/forum/14-compravenda-de-carros/
- XF link: https://a3clube.com/forums/compra-venda-de-carros.5/

When i access the old link all i get is this cryptic message :
The site is currently being upgraded. Please check back later.
with http code 500.

site is working fine otherwise.

Please advise.
 
Last edited:
Hi there,

I'm running into issues with using ibs2xf.php with IPB 3.1 -> XF 1.5 URL conversion.

My URLs were previously only of the showtopic variety (no vanity URLs) so, I'm just looking to get something a la

Code:
http://forums.sonicretro.org/index.php?showtopic=37160

EDIT FOR POSTERITY: I wound up circumventing the ibs2xf.php script altogether by manually using redirect rules in Nginx. Now, that works for me because I was on 3.1 and didn't have the 3.2+ vanity URLs, so I figured I'd share the hackaround:

Code:
location ~ /index.php {
   if ($query_string ~ "p=(.*)") {
        rewrite ^ https://forums.sonicretro.org/index.php/posts/$arg_p? permanent;
  }
   if ($query_string ~ "^showtopic=(.*)$") {
        rewrite ^ https://forums.sonicretro.org/index.php/threads/$arg_showtopic? permanent;
   }
   if ($query_string ~ "^showuser=(.*)$") {
        rewrite ^ https://forums.sonicretro.org/index.php/members/$arg_showuser? permanent;
   }

Is it ugly and worst practices? Yep. Does it do what it needs to do? Yep. The only major hiccup that occurs in this setup is the inability to use the st parameter for post count offsets, and given that I'm using a custom posts per page plugin it's a bit of a moot point (no way to replicate inside XF as far as I can tell).
 
Last edited:
Just sharing my full .htaccess file (in the Xenforo 2.0 installation directory) - the section/rule doing the magic is bold/red:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

#Uncomment to restrict access to one IP
#<RequireAll>
# Require ip x.x.x.x
#</RequireAll>

<IfModule mod_rewrite.c>
RewriteEngine On

# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
RewriteBase /forum

# Redirect to fix IPB links. Extracts the thread ID from the URL and then
# appends it to /forum/index.php?threads/<ipbThreadID> which maps and returns
# the Xenforo thread ID
RewriteCond %{QUERY_STRING} ^/(topic)/([0-9]+)
RewriteRule ^.*$ /forum/index.php?threads/%2 [R=301,L]


RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>

This is what I'm using to redirect threads from the old IPB 3.4 forum to Xenforo 2.0. The regex here:
RewriteCond %{QUERY_STRING} ^/(topic)/([0-9]+)
Picks up the highlighted part of this URL:

And then the rewrite rule:
RewriteRule ^.*$ /forum/index.php?threads/%2 [R=301,L]
Changes the URL and does a 301 redirect to become this (%2 above is the numeric thread ID from IPB):

Which then lets Xenforo do its thing and find the full thread URL like this:
 
Top Bottom