Thread: Miscellaneous Hacks - 404 / 301 after import redirect on import ids
View Single Post
  #16  
Old 07-30-2008, 10:14 PM
Jerry's Avatar
Jerry Jerry is offline
 
Join Date: Jun 2003
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jbeam View Post
Code:
http://thenewx.org/phpbb2/profile.php?mode=viewprofile&u=1594
This is an example of one of the old URL's. From what I can tell it looks right.
That is a default link for the profile and what the script is expecting, the default in the script should be fine, just set the domain :

PHP Code:
$old_folder     'phpBB/';     // With trailing slash
$old_ext_type    '.php';     // Including preceding dot 
Quote:
Originally Posted by tommythejoat View Post
Jerry,

I am planning to install this for my bbV2 migration. I presume there is no reason to keep all the code for the other message board combinations with the conditionals, switches and so forth. I can just hard code it for the bbV2 url forms.
Yes, you don't need any of it, it's the import id's in the vBulletin tables and this script that take care of the look ups and refrences to old data.

Quote:
Originally Posted by tommythejoat View Post
bbV2 does not support displaying posts independently of threads, and does not support displaying user profiles externally. I was planning to just provide the translation of thread and forum references.
Half the work then

Quote:
Originally Posted by tommythejoat View Post
Since bbV2 is a Perl script, the form of the urls are /bbBoard.cgi?a=viewthread;fid=3;gtid=305734 for a thread and bbBoard.cgi?a=viewforum;fid=3 for a forum. I could use your logic for the forum, but I will need to use a regular expression to skip the fid piece for threads.
True, for the forum it looks like a fixed length string with the forumid on the end so crop the string and what ever is left is the forum id, as for the thread id, i'd use this :

PHP Code:
// It's a thread link
if (strpos($_SERVER['REQUEST_URI'], "/{$old_folder}{$old_thread_script}") === 0)
{
    
$action 'thread';
    
$old_id intval(substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], 'gtid=')+5));
    
$sql "SELECT threadid FROM {$tableprefix}thread WHERE importthreadid={$old_id}";

Where :

PHP Code:
$old_folder "";
$old_thread_script "bbBoard.cgi?a=viewthread"
For :

PHP Code:
$_SERVER['REQUEST_URI'] = "/bbBoard.cgi?a=viewthread;fid=3;gtid=305734"
Quote:
Originally Posted by tommythejoat View Post
As mentioned in my previous response, I was modifying this tool to work with a bbBoardV2 migration.

A question comes up with respect to migrating between two different servers. The old server is still alive and clearly this script needs to run on the new server where vBulletin is located. If I put a redirect on the old board in place of the bbBoard.cgi script, I think that will handle it, but I am not sure.
You could update the DNS to send the old requests to the new server and have the web server handle it.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01527 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (4)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete