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

XF 1.1 Importing a part of xenForo to a whole new forum (xenForo)

Discussion in 'Installation, Upgrade, and Import Support' started by faeronsayn, Mar 20, 2013.

  1. faeronsayn

    faeronsayn Well-Known Member

    How hard is it to import let's say a section of your current xenForo forum to a whole new xenForo forum? And only import users that have posts from that forum? Also would it be easy to redirect the URLs?
  2. RoldanLT

    RoldanLT Well-Known Member

  3. Brogan

    Brogan XenForo Moderator Staff Member

    There is currently no direct XenForo to XenForo importer.

    You will need to go via other software such as phpBB, IPB or vB, assuming they have a XenForo importer.
  4. faeronsayn

    faeronsayn Well-Known Member

  5. CallieJo

    CallieJo Active Member

    I am currently doing something similar...splitting up parts of a forum into their own stand-alone forums.

    Right now I have a test forum that I am cleaning up. It contains all content and members. I plan on copying the database over to each new forum and deleting whatever I won't need for each particular forum. A lot of work, but it seems like the easiest route in my case.

    Good luck!
    faeronsayn likes this.
  6. faeronsayn

    faeronsayn Well-Known Member

    How are you planning on forwarding the URLs?
  7. CallieJo

    CallieJo Active Member

    Sorry, I don't have a solution for forwarding urls from just specific categories. It's pretty easy to forward "all" urls from one setup to another. But, I don't believe there is a way to forward only urls belonging to specific categories to another setup unless you had the category names in the thread urls. I could be wrong. Maybe a developer can help answer that question.

    For myself, I'm not worried about urls since I will be linking to the new forums anyways from the old one and I'm not concerned with backlinks and SE's and all that. I know it will all work itself out eventually.

    Hope you find the solutions you want.
    faeronsayn likes this.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  9. faeronsayn

    faeronsayn Well-Known Member

  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Then you can use similar queries to update the id maps for imported forums. The process is the same though.
  11. faeronsayn

    faeronsayn Well-Known Member

    I don't really have access to an IPB license at the moment.

    I was able to use the same database and delete all the forums I didn't need. Now i'd just need to redirect the threads that I didn't delete. Since the IDs of these threads remained the same, the URL redirection might be pretty simple?
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It's unclear to me exactly what process you are using. But for the purpose of redirects I need specific examples of before and after links.
  13. faeronsayn

    faeronsayn Well-Known Member

    This is what I am doing.

    Forum A has lets say 5 sections.

    I create Forum B on a new domain, and I want one of those 5 sections imported to forum B.

    So I use Forum A's database with Forum B. This new Forum B's database hold all of Forum A's content, but I delete the 4 other sections and leave one. At the end, I have 1 section in Forum B and 5 sections in Forum A.

    Now the section that I moved from Forum A to Forum B, needs to have all of it's threads inside it redirect to Forum B.

    The before and after URLs would be like



    The url structure and IDs won't actually change, it's just the domain name will change.

    What I am having difficulty with is to redirect only the threads within the section that I imported to forum b, not all threads.

    I was thinking maybe if it was possible to get all the thread IDs of the threads that were imported then use something like this link

    example.com/threads/thread-id/ <--- and redirect that.

    In any case, you'd probably have the answer to that.
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That will be difficult to do "nicely". You will need to check the node_id for every thread before redirecting, and the node_id is not in the URL. You would have to get into the PHP code to do the check.

    An exhaustive list of thread_ids would be an alternative to checking the node_id. How many threads total?
  15. faeronsayn

    faeronsayn Well-Known Member

    Looking at a couple thousand.

    I could probably query the database to get the thread_ids i'd assume? But throwing those in there with simple 301 redirects in the .htaccess file, I don't know if that'll work.

    With the php code, we'd probably have to run that code on each thread url, I am really not sure which way to go about it.
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Example of redirect with explicit list of threadids:

    RewriteRule ^threads/[^\.]+\.(1|2|3|4|5|6|7|8|9)/(.*)$ http://www.example2.com/threads/$1/$2 [R=301,L]
  17. faeronsayn

    faeronsayn Well-Known Member

    Is there a way to output all thread id's in that manner? I mean in this format : 1|2|3|4|5|6|7|8|9

    If there are about a few thousand listed like this, would this cause any problems?
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can export a list of thread_ids using phpmyadmin. Run this query using phpmyadmin:

    SELECT thread_id
    FROM xf_thread
    WHERE node_id IN (1,2,3);
    If you want to save the results then click Export at the bottom of the page in phpmyadmin after you run the query. It will give you lots of format options. I would probably export it as an Excel or CSV and then import into Excel. Then use some Excel functions to concatenate a list together. This requires some dexterity.
  19. faeronsayn

    faeronsayn Well-Known Member

    I tried the above code, and it didn't work for some reason.

    <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 /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) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^threads/[^\.]+\.(37976|24569)/(.*)$ http://www.mynewdomain.com/threads/$1/$2 [R=301,L]
  20. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Put it right after RewriteEngine On

Share This Page