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

XF 1.3 A few transitional questions

#1
I posted a while back with some pre-sales questions and since then I've made the jump and have been running a test site for the past few weeks, with the import of our vBulletin database having gone smoothly and the design work coming along nicely.

I've found good replacements for most of the forum functionality we rely on so think we're close to ready to make the move, but just have a few questions remaining from my initial post.

Allowing users to see their own deleted posts, we did a code modification on vBulletin, but haven't been able to find a way so far of achieving it with XF. We find it a good way of communicating with members to have their posts/threads not just vanish.

Likewise, is there an option to name the specific moderator on an 'edited by' statement. Again as it allows users to contact the moderator that acted on their post directly.

And can someone assist in getting our vBSEO urls converted over to Xen?

Thanks again for everyone's help - spending the time looking around here has solved the majority of the problems and has me quite confident in pulling off the move successfully.
 
#2
I found this tool for doing the conversion - http://tools.geekpoint.net/xfseo/ - however I get 'Unsupported url format.' for the forums - and when I apply the other redirects to the htaccess file, they don't seem to do anything. I've got the redirection scripts in place.

Some examples:
/forums/general-chat/ is /forums/forums/general-chat.5/ on Xen
/forums/general-chat/introductions-21709-6.html becomes /forums/threads/introductions.21709/page-6

How do I go about fixing the rest of the urls?
 

Mike

XenForo developer
Staff member
#3
If your forums don't have IDs, you need to manually write redirects for each forum that you need to redirect.

As for the redirects not working, what's happening when you try to hit them? It's possible that the redirect scripts themselves aren't configured correctly (based on what you did with the import log).
 
#4
As for the redirects not working, what's happening when you try to hit them? It's possible that the redirect scripts themselves aren't configured correctly (based on what you did with the import log).
*facepalms* missed that 301config file totally.

Okay, so that's got the thread links working, but not the pagination/permalinks within them - so it finds the right thread but not the specific posts.

For example - forums/general-chat/random-thoughts-62180-318.html#post1979348 converts to /forums/threads/random-thoughts.62180/#post1979348 but doesn't go to that post or the page number 318.

In addition, I noticed there's a few single post links that are in the format of /forums/1979365-post4758.html which is just the post id without any reference to the thread id.

Here's the .htaccess as it stands
Code:
#    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 500 default

<IfModule mod_rewrite.c>
    RewriteEngine On
   
    RewriteRule [^/]+/.+-([\d]+)-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/.+-([\d]+).html showthread.php?t=$1 [NC,L]

    #    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 /xenforo

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    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>

If your forums don't have IDs, you need to manually write redirects for each forum that you need to redirect.
I'm mostly concerned about old links in posts working, so if links to specific threads are working that's probably enough. Search engines should pick up the changes to the new urls fast enough I'd have thought?

Thanks for the assistance.
 

Mike

XenForo developer
Staff member
#5
If the page number isn't being converted, you need to check 301config.php to cover that as well. If your redirect is being hit then it's likely that option.

The post element can't be converted as it is not passed to the server so it cannot be modified.
 
#6
If the page number isn't being converted, you need to check 301config.php to cover that as well. If your redirect is being hit then it's likely that option.
I can't see anything in that file that's relevant to page numbers, just the import log table and the address of the files. I've tried the showthread.php file manually, putting in ids and a page number, and no luck there either, though I noticed that my rewrite was wrong in passing it a 'page=' instead of 'p=', but that didn't seem to change anything.

Would I perhaps have better luck using this tool and trying to manually replace the urls in posts over to the format of the XenForo links, rather than trying to rewrite?
 

Mike

XenForo developer
Staff member
#7
You don't see this option at the end of 301config.php?
Code:
define('INCLUDE_PAGE_LINKS', false);
It defaults to false because you have to ensure that you make the necessary configuration changes for it to work.
 
#8
You don't see this option at the end of 301config.php?
Code:
define('INCLUDE_PAGE_LINKS', false);
It defaults to false because you have to ensure that you make the necessary configuration changes for it to work.
That's again weird - I must have somehow truncated that file or something because I downloaded the redirection scripts again and it's there in the archive, but wasn't in the file on the server. I've reuploaded all of them as well and now I've got them working.

Thanks again - I'm so close now :).

I noticed while doing that the in page anchor tags are '#post-1979365' vs the '#post1979365' from vB, so I've added in an anchor tag to add in the version without a dash, and now those post links are working to take me straight to the right post on the right page.

Another thing I've noticed is that the '/forums/goto/post?id=1662551' syntax works to find individual posts, which we have linked to with a /forums/1979365-post4758.html format - how would I rewrite that?
 
#10
Try:
Code:
RewriteRule [^/]+/.+-post([\d]+).html showpost.php?p=$1 [NC,L]
That didn't work, but got me on the right track -
Code:
 RewriteRule ^([\d]+)-post\d+.html showpost.php?p=$1 [NC,L]
Ended up being the one I needed. Now both styles of links are pointing to the correct posts.

I also managed to figure out the other thing in my original post - I've ended up setting the permission for being able to see deleted posts/threads, and then using the templates to then hide other user's deleted posts/threads from non-moderators. It's probably bad in terms of efficiency, but has got the job done.

Thanks so much for your help.
 
#11
Completed this migration successfully today - thanks again for the help.

Thought I'd note something I ran into as an issue in case it assists someone else - because vBulletin 3.8 doesn't/didn't seem to in my installation, process png attachments for thumbnails, I was getting caught up while migrating the attachments. I had tried going through and deleting them - but I crashed back with an error every few ticks.

Ended up making a change to the /library/XenForo/Image/Gd.php file, adding a failover for the imagecreatefrompng method. I put a placeholder png image in the internal_data/temp folder, and got the image to be created from that in the case the first attempt failed.

PHP:
 case IMAGETYPE_PNG:
                    if (!function_exists('imagecreatefrompng'))
                    {
                        return false;
                    }
                   
                    $image = @imagecreatefrompng($fileName);
                   
                    if(!$image) { $image=imagecreatefrompng(image_preview.png);}
                   
                    break;
Maybe there's a better way to code it, but it worked for me and got everything moved across successfully.