Announcement

Collapse
No announcement yet.

vBulletin 5 Database Tools

Collapse
X
Collapse
  •  

  • vBulletin 5 Database Tools

    The vBulletin Database Tools are a series of command line scripts that allow you to quickly make modifications to your database in order to provide performance fixes and update them to UTF8 standards.

    IMPORTANT- These files must be run via the command line, either if you have local access to the server or ssh access. If you are on shared hosting your access may be limited. You may ask your host for ssh access. If they say it is not available ask if they will run the commands for you.

    Update VB5 tables to InnoDB and UTF8

    Each script is listed under these steps with specific information for that script.

    1. Rename vbutil_config.php.new to vbutil_config.php
    2. Edit vbutil_config.php with a code editor and enter your database credentials. If unsure of the database credentials they can be found in the /core/includes/config.php file.
    3. Upload the utf8_db_tools directory to your server. They do not need to be in your vBulletin directory. They do need to be accessible from the command line.
    4. In forum Admin CP turn off vBulletin under Settings -> Options -> Turn your Forum On/Off
    5. Take a full backup of the forum database.
    6. Reread step 4. This cannot be skipped. I actually recommend using a full copy of your database for the first run.
    7. With command line change the directory to the directory where you placed the files.
    8. If you are not using INNODB tables, Run the MyISAM fix script listed below.
      • This is only necessary if your are not using INNODB tables.
    9. If you are using English on your site, then you would run the UTF8Tablefix script.
      • If you are not using English, do not use this script.
    10. Run the UTF8Convert script listed below.
      • Wait again, this can take a long time, especially the node table.
    11. Run the Serialize fix script listed below.
      • Wait a bit but this is usually fast.
    12. Go to your Admin CP and open Languages & Phrases -> Language Manager
    13. Edit the settings of each language. Check the HTML Character Set setting and if it isn't UTF-8 change it to UTF-8.
    14. Rebuild your search engine.
    15. Check forum, make sure it is working as expected.
    16. When you are finished, delete the utf8_db_tools directory from your server.
    17. Turn your vBulletin back on in the AdminCP Settings.

    MyISAMFIX

    This tool will convert vBulletin 5 tables to INNODB from MyISAM. This change will generally provide a performance boost to a website. In addition it can help prevent table crashes and improve replication services. Before running this, use your database tool to check if it is needed. If your tables are already INNODB, there is no need to run this. This file will only convert default vBulletin 5 tables. Tables from previous versions or addon products will remain untouched.

    php myisamfix.phar -dofix
    

    UTF8TableFix

    This script is only useful if you're converting an English Language database to UTF-8. It has no parameters or options. The command is:

    php utf8tablefix.phar
    

    UTF8Convert

    For sites in other encodings or with multiple languages you need UTF8Convert. This script has several parameters. We recommend using UTF8MB4 with MySQL and MariaDB. This will allow you to use multiple languages properly as well as the popular UTF-8 Emoticon standard. This file will attempt to convert your actual data.

    php utf8convert.phar --options
    

    Required options are --connectionCharset and --charset. e.g.

    php utf8convert.phar --connectionCharset=latin1 --charset=utf8mb4
    

    All Options

    • --connectionCharset=[value] (required): This refers to whatever the previous site used. Commonly older sites will have latin1 and newer sites will have utf8, but it might be something different. This is the value from config.php for $config['Mysqli']['charset'], if specified. If the value is not specified in your /core/includes/config.php file it can be determined by running this query:
    SHOW SESSION VARIABLES LIKE 'character\_set\_client';
    
    • --charset=[value] (required) : This is the new charset, and should always be 'utf8mb4'
    • --wipeSearch=1 (optional) : If set the utility will truncate all the searchtowords tables before converting. I recommend you always set this, for two reasons. First, there are often words that are NOT duplicates in one encoding but ARE duplicates in a different encoding. By far the easiest way to avoid these problems is to wipe the data. Second, the conversion process is time consuming for anything over a few hundred thousand posts, and setting this makes it quicker.
    • --collateCI=[value] (optional) : This will default to utf8mb4_unicode_ci. This is the recommended collation.
    • -–collatebin=[value] (optional) : This will default to 'bin' added to the charset.

    SerializeFix

    This will fix serialized fields after you have converted them to UTF8MB4. Your vBulletin may not work if you skip this step.

    php serializefix.phar
    

    Database Compare

    This is a database repair tool. It will compare two databases and create a list of queries to help synchronize the structures between them. This script should work with any version of vBulletin. To use it, set the Source values in the vbutil_config.php file to match a clean installation of vBulletin. This installation should match the version you want to compare with. The standard database options in the vbutil_config.php file should point to the database that is currently experiencing issues.

    php dbcompare.phar indexscript > update.sql
    

    You can run the queries by importing them in any tool that allows you to run MySQL Queries

    Example:

    mysql -u%user% -p %databas% < update.sql
    

    Replace %user% and %database% as appropriate.


    • saiff
      #1
      saiff commented
      Editing a comment
      Is this procedure also valid for the arabic language?

    • Wayne Luke
      #2
      Wayne Luke commented
      Editing a comment
      The UTF8Convert script should update Arabic. Always make a backup.

    • saiff
      #3
      saiff commented
      Editing a comment
      collateCI=[value] (optional) : This will default to utf8mb4_unicode_ci. This is the

      Also for the arabic language?
    Posting comments is disabled.

About the Author

Collapse

Wayne Luke A curious juxtaposition of nature, technology and sustainability. Find out more about Wayne Luke

Article Tags

Collapse

advanced (5) android (2) api (29) array (17) beginner (17) blog (4) calendar (2) cloud (1) cms (2) create (1) customization (1) database (1) forum (3) forums (4) Intermediate (7) iphone (3) mapi (30) methods (10) mobile (34) poll (1) security (2) style (2) threads (4) vb5howto (5) vBulletin (5)

Latest Articles

Collapse

  • vBulletin 5 Database Tools
    by Wayne Luke
    The vBulletin Database Tools are a series of command line scripts that allow you to quickly make modifications to your database in order to provide performance fixes and update them to UTF8 standards. IMPORTANT- These files must be run via the command line, either if you have local access to the server or ssh access. If you are on shared hosting your access may be limited. You may ask your host for ssh access. If they say it is not available ask if they will run the commands for you. Update VB5 ...
    Mon 21st Oct '19, 10:29am
  • The Basic Anatomy of a vBulletin Page
    by Wayne Luke
    vBulletin 5's user output is created using a system of pages that are customizable by the site administrator. This system is called Site Builder. By breaking the system down into pages, a lot of control is given to the system administrator. By using Site Builder, you can create a unique site without any knowledge of HTML or CSS.

    vBulletin's pages are created using layers built upon a grid layout. Each page starts with a layout which defines the content areas of the page. Layouts define...
    Mon 11th Sep '17, 9:55am
  • Enabling Push Notifications in vBulletin 5.3.2 and Mobile Suite 1.16
    by Wayne Luke
    vBulletin Mobile Suite 1.16 includes functionality for Push Notifications. One of the requirements to add this functionality is that you must be running vBulletin 5.3.2 Connect on your site and create a project with Google's Firebase Cloud Messaging (FCM) platform. The steps below will walk you through the process of enabling this functionality in vBulletin and in your Mobile Apps.

    Add a project to your Firebase account








    ...
    Thu 27th Jul '17, 9:56am
  • Enabling Two-Factor Authentication
    by Wayne Luke
    vBulletin 5.3.0 and higher will allow site owners to enable Two-Factor Authentication for Administrator and Moderator functionality. This is an extra layer of security provided to make sure your user data remains as safe as possible. Two-Factor Authentication works in conjunction with an app on the user's smartphone, tablet, or computer. These apps provide a security token that lasts a limited time before expiring. The security token is created using industry standard algorithms and a unique string...
    Tue 4th Apr '17, 9:38am
  • How to moderate the posts of new users only
    by Wayne Luke
    To help combat spam, many users opt to have new user’s posts moderated until they’ve made a specific number of posts. This allows the Admin/Moderator team to keep potentially malicious posts out of the public eye until a user has effectively passed a ‘probationary period’ as a member of the site.

    In order to do this, you will need to create a custom usergroup and a promotion.

    Creating a Custom Usergroup
    First, you need to setup the usergroup for your non-Moderated...
    Wed 22nd Feb '17, 10:13am
  • Rebuilding the Sphinx index
    by Wayne Luke
    From time to time, we will need to update the indexing schema for the Sphinx server. In order for this fix to take effect, you will need to update the sphinx schema for the index. Follow these steps to rebuild your Sphinx Search Schema.
    1. Stop the Sphinx service on your server.
    2. Replace your existing Sphinx configuration file (vbulletin-sphinx.php) with the one provided in the current version of vBulletin 5 Connect. You can find this file in the do_not_upload directory.
    3. Update the file as provided
    ...
    Fri 3rd Feb '17, 2:01pm
Working...
X