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

Which vB tables are used for import?

steven s

Well-known member
#1
Like the title says.
My live database is too big for me to manage.
I'd like to export only those tables needed for the import.
Judging my /library/XenForo/Importer/vBulletin.php

I find From statements associated with
attachment
customavatar
forum
forumpermission
language
moderator
pm
pmtext
poll
pollvote
post
setting
subscribethread
thread
user
usergroup
visitormessage​
Are there others?
 

Jake Bunce

XenForo moderator
Staff member
#2
That looks like all of them. I haven't tested importing from a selective backup like this though.

You have the right idea looking in the library/XenForo/Importer/vBulletin.php file.

I would note that the tables needed for the import are basically all of the large tables. I don't imagine you will save much space by exporting only those tables.
 

Jake Bunce

XenForo moderator
Staff member
#3
Actually, you are missing several user-related tables. For example, see this query in the file:

Code:
    protected function _getSelectUserSql($where)
    {
        return '
            SELECT user.*, userfield.*, usertextfield.*,
                IF(admin.userid IS NULL, 0, 1) AS is_admin,
                admin.adminpermissions AS admin_permissions,
                IF(userban.userid IS NULL, 0, 1) AS is_banned,
                userban.bandate AS ban_date,
                userban.liftdate AS ban_end_date,
                userban.reason AS ban_reason,
                userban.adminid AS ban_user_id,
                IF(usergroup.adminpermissions & 1, 1, 0) AS is_super_moderator,
                IF(customavatar.userid, 1, 0) AS has_custom_avatar
            FROM ' . $this->_prefix . 'user AS user
            INNER JOIN ' . $this->_prefix . 'userfield AS userfield ON (user.userid = userfield.userid)
            INNER JOIN ' . $this->_prefix . 'usertextfield AS usertextfield ON (user.userid = usertextfield.userid)
            LEFT JOIN ' . $this->_prefix . 'administrator AS admin ON (user.userid = admin.userid)
            LEFT JOIN ' . $this->_prefix . 'userban AS userban ON (user.userid = userban.userid)
            LEFT JOIN ' . $this->_prefix . 'usergroup AS usergroup ON (user.usergroupid = usergroup.usergroupid)
            LEFT JOIN ' . $this->_prefix . 'customavatar AS customavatar ON (user.userid = customavatar.userid)
            WHERE ' . $where . '
            ORDER BY user.userid
        ';
    }
Lots of joined tables you will need.