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 Import & Maintenance menu on the left of the AdminCP.
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
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.
When you have selected the required options, click on Continue.
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.