• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Import Guide

Jake Bunce

XenForo moderator
Staff member
#1
For this guide I am using the vB importer as an example.

Overall Approach For Importing

I recommend doing a test import first so you can work out any problems before going live. Once you are satisfied with the results then install another copy of xenForo and run the import again from scratch. Use the test forum as a point of reference when doing your final import, as opposed to building onto your test forum and taking it live. If you have done any custom development on the test forum (e.g. custom styles and addons) then you need to apply those changes to the "from scratch" copy of xenForo when doing the final import.

It is better to do the final import from scratch. The test forum won't contain new content that was added to your live forum since you ran the initial import, and there is no option to pull in only the new content. So you would have to run the entire import again and deal with duplicate content from the initial import.

Running The Import

First you need to install xenForo in a separate location from your vB forum. Use a separate database.

Once xenForo is installed then login to the Admin CP and access the importer:

import1.png

Once you have selected the source system then click Configure Importer. Fill in the mysql connect info for the vB database and click Validate Configuration. You will find this information in vB's includes/config.php file:

import2.png

Then you will be taken to the list of import modules. Run each module in order:

import3.png

Most of them run without requiring any input from you, except for the Import Users module which has merge options to resolve username and email conflicts:

import4.png

If you opt not to automatically merge users then you will be allowed to manually deal with conflicts at the end of the user import:

import5.png

It is important to note that xenForo requires a unique email address for each user. If your source forum allows duplicate emails (as vB does) then conflicts will be reported for those users. The importer will require you to either merge those users or change one of the emails. You may wish to deal with those conflicts in vB before running the import.

When you have finished running all of the modules then the importer will do some cleanup and present you with this page:

import6.png

You should do as it says and check the forum permissions and rebuild the search index:

import7.png

Rebuilding the search index can take a long time on large forums, so plan accordingly. You may wish to run the rebuild overnight when traffic is low.

Cleanup

Some people have requested queries to mass mark all PMs as read following an import. See this post:

http://xenforo.com/community/threads/mass-mark-pm-as-read.12698/#post-167005

I came up with these queries for you. You can run these queries on your database to mark all PMs as read:

(added semicolons per DSF's post):

Code:
UPDATE xf_conversation_recipient
SET last_read_date = UNIX_TIMESTAMP();

UPDATE xf_conversation_user
SET is_unread = 0;

UPDATE xf_user
SET conversations_unread = 0;
I tested this and it works. But you should backup first to be safe.
Similarly, some people want to clear out the moderation queue following an import and mass approve all moderated threads and posts. See this post:

http://xenforo.com/community/threads/sql-query-for-approving-moderated-posted.16283/#post-214789

Don't forget the xf_moderation_queue records. You would need to run these two queries to approve all moderated posts (borrowing Mikey's query):

Code:
DELETE
FROM xf_moderation_queue
WHERE content_type = 'post';

UPDATE xf_post
SET message_state = 'visible'
WHERE message_state = 'moderated';
And here are the queries to approve all moderated threads (per this post):

Code:
DELETE
FROM xf_moderation_queue
WHERE content_type = 'thread';

UPDATE xf_thread
SET discussion_state = 'visible'
WHERE discussion_state = 'moderated';
You also need to run this query to reset the count in the moderator bar (per this post):

Code:
DELETE
FROM xf_data_registry
WHERE data_key = 'moderationCounts';
 

Dean

Well-known member
#3
Tips/suggestions:
  • Put the xf forum in a password directory before import, you really don't want to show the world your forum before the permissions are set up.
  • Reduce the number of user groups to the least necessary for your site, before importing. We had several usergroups that were not *really* that important. While setting the permissions is quite easy, the fewer usergroups the better.
  • Re-arrange the forums for the new xf forum as much as possible before the import. For instance, at this time there is no 'can see other persons threads' permissions (vb3.8 admincp -> forums & moderators -> Forum Permissions -> "Can View Others' Threads")... so everyone will see everything after the import if you were using that feature. You may as well deal with those types of forums before import. I hid them from everyone except myself.
  • There may be residual permissions from forums & categories in vb, and also usergroups that may no longer exist. In vb there is a 'reset' and 'deny all' on a forum for the permissions. That really helped clean up our forums permissions.
  • You may want to think about doing as many things before the import as possible such as styles/template changes, smilies, custom BBCode, fonts, etc.
  • For testing purposes don't be afraid to do multiple imports, and document what you did each time, so it can be replicated.