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

XF 1.3 Forum Redirection (XF to XF)

Discussion in 'Installation, Upgrade, and Import Support' started by yavuz, Aug 9, 2014.

  1. yavuz

    yavuz Well-Known Member

    I'm finalizing the importing process but couldn't find how the old users, forums, threads are redirected to the new board (merged one).

    The old one and the new one are both inside a subdirectory (/forum). Can anyone provide me with a .htaccess code?

    Thank you.
     
    Breixo likes this.
  2. ibrian

    ibrian Active Member

    If you're talking about having had two separate forums, with their own software, and then you really want each install in their own separate folder - otherwise, which index.php would each be using?

    However, do you mean that you are using Kier's redirection script, where some files need to be included among another install for redirects to work?
     
  3. yavuz

    yavuz Well-Known Member

    I have imported a XenForo forum to another XenForo Forum. I'd like to remove the old one and redirect the site to the migrated site.
     
  4. Mike

    Mike XenForo Developer Staff Member

    Breixo likes this.
  5. yavuz

    yavuz Well-Known Member

  6. Mike

    Mike XenForo Developer Staff Member

    Breixo likes this.
  7. yavuz

    yavuz Well-Known Member

    What I did so far;
    • Modified the config and uploaded the script to the root of my new forum
    PHP:
    <?php

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

    If you have not installed XenForo into the same directory in which
    vBulletin 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/myuser/public_html/forum';
    #
    #    $fileDir = 'C:/inetpub/wwwroot/xenforo';
    #
    \* ----------------------------------------------------------- */

    //    $fileDir = '/home/myuser/public_html/forum';

    /* ----------------------------------------------------------- *\
    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_log1');
    #
    #    define('IMPORT_LOG_TABLE', 'import_log_my_forums');
    #
    \* ----------------------------------------------------------- */

        
    define('IMPORT_LOG_TABLE''archived_import_log2');

    /* ----------------------------------------------------------- *\
    This constant controls whether or not to include page number links
    in your redirects. In order for this to work, the number of posts
    shown per page in vBulletin MUST match the number of posts shown per
    page in XenForo, and the number of threads shown per page on
    vBulletin's thread listing pages must be the same as that used by
    XenForo, or the links will be wrong. If they do not match, leave
    this constant defined as 'false'. If they do match, change the
    definition to 'true'.
    \* ----------------------------------------------------------- */

    define('INCLUDE_PAGE_LINKS'false);
    • Added following lines to the .htaccess to the old forum:
    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^threads/[^\./]+\.([0-9]+)/ http://www.kadinlarforumu.com/forum/showthread.php?t=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^forums/[^\./]+\.([0-9]+)/ http://www.kadinlarforumu.com/forum/forumdisplay.php?f=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^categories/[^\./]+\.([0-9]+)/ http://www.kadinlarforumu.com/forum/forumdisplay.php?f=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^members/[^\./]+\.([0-9]+)/ https://www.kadinlarforumu.com/forum/member.php?u=$1 [R=301,L]
    
    Unfortunately getting this error:

    An unexpected database error occurred. Please try again later.

    Code:
    Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Table 'myuser_xfdb.import_log_2' doesn't exist - library/Zend/Db/Statement/Mysqli.php:77
    Oluşturan: Bilinmeyen Hesap, 2 dakika önce
    Yığın Takibi
    
    #0 /home/myuser/public_html/forum/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('\n\t\t\t\tEEECT old_...')
    #1 /home/myuser/public_html/forum/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '\n\t\t\t\tEEECT old_...')
    #2 /home/myuser/public_html/forum/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('\n\t\t\t\tEEECT old_...')
    #3 /home/myuser/public_html/forum/library/Zend/Db/Adapter/Abstract.php(808): Zend_Db_Adapter_Abstract->query('\n\t\t\t\tEEECT old_...', 'node')
    #4 /home/myuser/public_html/forum/library/XenForo/Model/Import.php(351): Zend_Db_Adapter_Abstract->fetchPairs('\n\t\t\t\tEEECT old_...', 'node')
    #5 /home/myuser/public_html/forum/library/XenForo/Model/Import.php(489): XenForo_Model_Import->getImportContentMap('node', 42)
    #6 /home/myuser/public_html/forum/forumdisplay.php(29): XenForo_Model_Import->mapNodeId(42)
    #7 {main}
    
    Talep Yeri
    
    array(3) {
      ["url"] => string(57) "http://www.kadinlarforumu.com/forum/forumdisplay.php?f=42"
      ["_GET"] => array(1) {
        ["f"] => string(2) "42"
      }
      ["_POST"] => array(0) {
      }
    }
    
    The archived_import_log2 log does actually exist in the targer forums database
     
    Breixo likes this.
  8. Mike

    Mike XenForo Developer Staff Member

    Based on that error message, it's using the table import_log_2 not archived_import_log2.
     
    yavuz likes this.
  9. yavuz

    yavuz Well-Known Member

    I sorted it out, apparently it was a Filezilla madness! Thanks @Mike, the htaccess is working now.

    For those who will need the .htaccess code here is the one worked for me

    Annelervekuzular.com (Old Forum)
    Kadinlarforumu.com (New - Migrated into)

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^threads/[^\./]+\.([0-9]+)/ http://www.kadinlarforumu.com/forum/showthread.php?t=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^forums/[^\./]+\.([0-9]+)/ http://www.kadinlarforumu.com/forum/forumdisplay.php?f=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^categories/[^\./]+\.([0-9]+)/ http://www.kadinlarforumu.com/forum/forumdisplay.php?f=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?annelervekuzular\.com$
    RewriteRule ^members/[^\./]+\.([0-9]+)/ http://www.kadinlarforumu.com/forum/member.php?u=$1 [R=301,L]
    RewriteRule (.*) http://www.kadinlarforumu.com/forum/$1 [L,R=301]
     
    Breixo likes this.

Share This Page