No announcement yet.

Introduction to basic concepts for using vBulletin.


  • Introduction to basic concepts for using vBulletin.

    In this blog, and going forward in future blog posts we’re going to discuss basic concepts and work flow of vBulletin. There are very basic concepts of using the software that often get confused, interpreted wrongly, or you end up trying to going against what the normal workflow would be.

    What is vBulletin, and how does it work?

    vBulletin is a PHP and MySQL application. In its most basic form we have two parts to the software, the files which contain php programing, and the database which stores our information. It is important to understand that your vBulletin php files are the way that we (everyone who uses your site) interacts with the database. They do not hold any of your posts, threads, comments, articles, pictures, etc. One file does hold some very important information, which is the config.php file. This file holds all of the database connection information. You should keep a backup of this file, just in case you delete it or it gets mangled or destroyed somehow.


    The most important thing to take away from this is that your database is 99% of your vBulletin installation. It is very important to keep backups, be willing to use them, and make sure they’re in good working order so when and if something bad happens you can get your site back on its feet ASAP. Often we have customers who keep backups do not check to make sure they’re in good working order, or want to go through great lengths to try not to lose a few days of content. We are sympathetic to your issue at hand that something has gone wrong and you don’t want to lose anything if at all possible. But if the fix is going to take an equal number of days to the lost content, what is worse: Forum down for 3 days, or losing 3 days of posts/threads?

    Common misconceptions

    There are a few common misconceptions we run into while providing support for vBulletin and that I’d like to take the time to explain here since we’re talking about the basics. These two are the big offenders: “clean” upgrades and moving servers. We’ve talked about the fact that your board is 99% in the database, this means that if you’re moving servers you need to move the database. There is no need to install the software on the new host in the sense of when you did your first vBulletin installation. Your database backup contains all of the vital information, as well as instructions for MySQL to accurately recreate all of its stored information.

    The same is true for “clean” installations. Often you have a lot of old addons, or you’re going from one major version to another. You think to yourself “I will install a new version of vBulletin and then restore my database!”. The problem with this is that you’ve just destroyed all of the work you did to your clean install, and created a monster of a hybrid database. You’ve got tables and schemas with the new version of vBulletin, and your old data. It will be almost impossible to upgrade this database, or even repair it and get it in working order.

    Maintenance tools and what they’re there for.

    vBulletin has a fairly wide set of tools available to help fix things, should they go wrong, or if something needs to be repaired. But it is very important to understand when you should run them if at all. The two big tools we’re going to talk about today are the MySQL repair and optimize commands that are featured in the software. Often people associate repair and optimize with a way to speed up their site when nothing is actually wrong with it. It’s important to understand what each does and why you should and shouldn’t run them.

    Repairing a crashed table

    The Repair function is present because sometimes, fairly rarely, a table in the database will crash. Here are some of the reasons why a table may crash, but be aware this is not a comprehensive list:

    • Hardware failure
    • Power failure
    • MySQL crashed, or went down during a query that had not finished.
    • External programs altering the MySQL data files.

    Your site may be displaying a page that lets users know that the database has had a problem and someone has been alerted. If you’re running older versions of vBulletin, or are logged in and can be recognized as an administrator, you can view the source of the page and see the true error message. If you cannot be recognized as an administrator, you should have had an email sent to the {techemail} in your config.php with a copy of the whole database error. It’s important to get these error messages, they help you or the vBulletin staff help figure out what the real problem is so we can get it fixed.

    MySQL Error : Table './database_name/post' is marked as crashed and should be repaired
    Error Number : 145
    In this specific example, the post table has crashed, and needs to be repaired. Since you’re an administrator and can still likely login to the forum, your first steps would be to go to AdminCP > Maintenance > Repair / Optimize tables > Find and select the post table, and choose the repair option and click continue

    It may take several times to fully fix the table. Hopefully it gets repaired, in a worst case scenario you may need to restore a complete backup.

    It is very important to note that if the database is not crashed, you should not ever run the repair table tool. While it should not cause any damage to a table normally, it might, or it might cause the table/database to lock and cause MySQL issues. The repair function in some cases will remove data from the table to fix it.

    Optimizing your tables

    This is another function that shouldn’t need to be run much if ever, and isn’t fully supported for all table types. Optimize is only supported for vBulletin’s needs for the MyISAM table, MEMORY/HEAP, and InnoDB are not supported normally and you should not ever need to run the optimize function on them.

    The only case optimize is really needed is if you’ve removed (completely, so hard delete) a large amount of information from the database, either overtime or all at once. For example over the last year you’ve removed 10,000 posts and users. You may want to run an optimize command on the post and user tables to help MySQL reclaim some space it is still holding onto. You can run it just like we went over the repairing the post table in the previous section but you should choose optimize instead of repair.

    • mikemyers
      mikemyers commented
      Editing a comment
      Thank you for posting. Can I ask what probably sounds like a very simple question?

      You wrote: "The most important thing to take away from this is that your database is 99% of your vBulletin installation. It is very important to keep backups, be willing to use them, and make sure they’re in good working order so when and if something bad happens you can get your site back on its feet ASAP."

      I did a backup of my installation a few months ago, but apparently it generated database errors, because I was backing it up while the forum was active. What is the preferred method of doing a backup?

      Also, unless I were to set up another installation of vBulletin, how could/would I check to make sure my backup is complete and valid?

    • Zachery
      Zachery commented
      Editing a comment
      Mike, you'd normally want to close the site in the admincp and then backup.

      There are lots of good tools you can use to backup.

      You may still get db errors while backing up, because the data is being exported and is locked. So users cannot write posts etc.

    • alaska_av8r
      alaska_av8r commented
      Editing a comment
      Good post Zachery, I agree that a note should be put in admin CP about the optimize function. For a large number of us maintenance is a key word that we interpret as:

      maintenance = keep things in good running order, make them run smoother, as in routine maintenance, perform on regular basis (like an oil change)


      repair = fix something that is broken
    Posting comments is disabled.

Related Topics