vBulletin database maintenance

an article added by: Linda Gould at 05312007


In: Root » Internet and online » Forums » vBulletin database maintenance

French Spanish Portuguese Italian German Japanese Chinese Korean Russian Arabic

Maintaining the Database
Without the data, your community is gone. Not only will you lose all the forums that have been set up (along with any customizations and changes you made), but you will also lose all the people. By this, I mean you will lose all the members lose the database and their accounts. Usernames, passwords, everything will be lost.
Running a forum without taking care of the database is asking for trouble. Not only might you run into problems and difficulties when you make a change to the forum (such as adding new features or upgrading vBulletin), but also your data is vulnerable to damage if the server hosting your community encounters problems. Small database problems can quickly grow into major issues, and the best defense against problems is to keep a backup.
vBulletin has a lot of features to allow you to protect your precious data from damage, corruptions, and loss. These tools can be accessed through the 126 Import & Maintenance menu on the left of the AdminCP.

Backing Up the Database
vBulletin makes this job quite easy as long as your database isn't too big. How big is too big depends on a variety of factors, but if your database is under 250 Mb, you should be able to use this feature just fine.
Back to basics
For large databases, saving the database via the command line is recommended. This is done using the following command:
shell> mysqldump --tab=/path/to/some/dir --opt db_name
The backup interface is easy to use. It shows you all the tables that are available in the database that contains vBulletin (including non-vBulletin tables).
You should choose the tables you want to back up (it's probably best to choose all the tables initially) and then select at the bottom of the screen the location to save the backup to. This has to be a folder on the server that vBulletin can write to, so its chmod permission should be set to 777.

After you have done this, click on Save. The backup will then be carried out.
You can also back up single database tables into a CSV (comma separated variable) file, which is handy if you plan on making changes to the database.

Restoration of this database is carried out through the phpMyAdmin interface.
Command-line recovery
Recovery of a database through the command line is a two-step process. First, create a database to receive the data.
$ mysql -h localhost -u XXXXXX -p YYYYYY
Here XXXXXX is the username of the database and YYYYYY is the password.
Then move the data to the new database:
$ mysql -h localhost -u XXXXXX -p YYYYYY restored < db_name
Repairing and Optimizing the Database
Again, this process gives you access to all the tables in the database, not just the tables relating to vBulletin. You can choose to repair and optimize some of the tables, or you can repair and optimize all the tables.
At the bottom of the page choose whether you want to optimize the tables, repair the tables, or carry out both operations.

Backup first!
Make sure that you have an up-to-date backup before carrying out the repair/optimize process.

It is recommended that you run the repair/optimize process twice to make sure all problems are fixed.
Some Maintenance Issues
The Update Counterspage enables you to change many of the counters in the database.
Take your time
This process can take a lot of time there is no way to rush it, so it's best to start it and leave it to finish on its own.
These counters are important for the smooth running of the database, but they may require updating following a change to the database. These are some of the changes that you may need to make:
Updatetheforums This feature will update the information for each forum including last post information, thread count, and post count. This operation can be carried out after a mass moving or pruning of threads and posts.

Update user titles This will go through every user on the forums and determine their correct user title.
Update user names This will update user names everywhere they occur on your forums. This operation may need to be done after changing a user's name in the AdminCP.
Update post counts This will update the post count for each user by counting how many posts they have in the database. If someone has artificially inflated or deflated post counts by editing profiles in the AdminCP, then this procedure will reset the post counts to their true values.
Fix broken user profiles This will fix any broken user profiles.
Rebuild forum information This will update the forum counters (post counts) and also check for orphan moderators. You may need to do this after merging or deleting threads or posts in your forums.
Rebuild thread information This will update the thread counters including last post information, reply count, and view count. You may need to do this after moving or pruning threads or posts.
Rebuild similar threads This will search the forums for threads that are similar to each other. To show similar threads you need to enable the option in the vBulletin options. If you want your forums to search for similar threads when a new thread is posted (rather than having to update this counter later), then you need to enable the option on this page.
Rebuild search index This will need to be done after changing the max/min search word length in the vBulletin options.
Rebuild statistics This will rebuild the information that is displayed on the vBulletin Statistics page.
Rebuild post cache vBulletin doesn't parse vB code in posts each time they are displayed. Instead the parsed posts are saved in the post_parsed table. This reduces the processing time needed to display a post. Updating this counter will rebuild the parsed posts. This needs to be done after changing vB codes or posting allowances.
Delete duplicate threads

Delete duplicate threads Sometimes duplicate threads are created during the posting process. Updating this counter will remove those duplicates.
Rebuild styles Updating this counter will rebuild the style structure.
Rebuild attachment thumbnails Rebuilding thumbnails is necessary after changing the thumbnail settings in the vBulletin options.

Rebuilduserreputation You will need to update this counter if you change the default reputation value in the vBulletin options.
Removeorphanthreads This will delete any threads that belong to forums that no longer exist.
Removeorphanposts This will delete any posts that belong to threads that no longer exist.

legal disclaimer

Our website is not responsible for the information contained by this article. Web-articles is a free articles resource.
Suggestion: If you need fresh, daily updated content for your website, feel free to use our service. Click here for more information.

related articles

1. The requirements of vBulletin
In the next article we're going to be shifting our focus to the installation and configuration of vBulletin. In this article we begin at the point where most people begin with vBulletin with a copy of the software and somewhere to upload it to. If you have both of those, then you are probably eager to get going with the installation! We will look at: • The requirements of vBulletin • How to install the files • How to create the database • How ...

2. The vBulletin Control Panel
The vBulletin Control Panel Now that you have come this far, you are probably eager to access the Control Panel and get started. Click on the link on the Step 13 page to access the Control Panel. (You will need to have deleted the install/install.php file before being able to continue.) After clicking on the link you will then need to enter the username and password you assigned to the administrator during the installation of vBulletin. Once you log into the Control P...

3. Importing Data into vBulletin
If you are moving to vBulletin from another type of discussion board, then there is a good chance that you won't want to lose all the posts that you already have and start again with nothing. And it's not just the posts that are important what about all your member information usernames, passwords, profile data? You don't want to lose all that and start with aIn the right-hand pane you get information about the version notice how we are being told that there is a newer version of vBulletin available. That's a really handy feature, and...

4. The vBulletin User Experience
A Tour of vBulletin In the previous article we looked at the vBulletin installation process. This process involved downloading the installation files, making edits to the configuration files, creating or preparing a database for vBulletin, uploading the installation files, and finally going through the vBulletin installation wizard. We also looked at how to import posts and settings from another discussion board into vBulletin. Now that you have a working vBulletin board, the next thing that you need to do is famili...

5. Customizing Your vBulletin Board
  Customizing Your vBulletin Board Most of the best discussion boards on the Web have been customized in one way or another. Some have only basic customizations to give the place a specific look and feel, while others have been heavily modified and customized to look, feel, and work exactly how the owners want them to. At this stage you probably want something in the middle you want a certain level of customization but don't want to take on too much too soon, right? That's fine the g...

6. vBulletin templates
Template Modifications So far we've looked at how to modify CSS stylesheet information, which controls how vBulletin looks, and the phrases, which control the text. Both of these modifications allow you to radically change how your vBulletin board looks and feels. Template modifications allow you to do a lot more and to make much more radical changes to your vBulletin installation. In fact, templates control nearly every aspect of a vBulletin board. Each page that the end user sees is the result of one or mo...

7. Hacking a vBulletin Board
Hacks So far we've talked about making modifications to a vBulletin installation, and we've looked at four different ways to modify the installation. So far we've called the changes 'modifications', but the term that you are more likely to see used on the web is 'hacks'. Whenever a board is modified, it is said to be hacked (not to be confused with 'hacked' as in the security being compromised by a hacker), and modifications are known as hacks as in "hacks to a board"...

8. Administering Your Forum
Administering Your Forum There's a lot to do as a forum administrator. It's not just about participating in the discussions, facilitating new discussion, and making the tough decisions as to who should be moderated or banned. There's a lot to do behind the scenes the day-to-day care of the forum as well as routine maintenance. You will also run into problems from time to time, and then you will need to carry out emergency repairs to get your forum going again. This article is about the most common tasks an adminis...

9. Smilies and avatars in vBulletin
Smilies Because a forum relies on text-based communication, anything that helps someone get their message across is a good thing. That's where smilies come in. They are little graphics that have a variety of faces displaying different emotions. Smilies are controlled through the control panel. If you click on Smilies in the left-hand menu, then three options will be made available. Clicking on SmilieManager will take you to a window where you can edit...