Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Building Forums With vBulletin (2006).pdf
Скачиваний:
40
Добавлен:
17.08.2013
Размер:
6.3 Mб
Скачать

Administering Your Forum

Add the user IDs inside the single quotes. Separate multiple user IDs with a comma.

With great power, comes great responsibility

Be very careful with this. The ability to run queries is a very powerful tool that we will come to later. Running queries can easily damage or destroy your discussion board and any other data in the database. For the safety and security of your board, you may want to remove all user IDs from this list and allow queries to be run only through phpMyAdmin or through a shell.

Undeletable and Unalterable Users

You might want your administrators (or other members) to be undeletable and unalterable. (This refers to the profile settings.) This setting can be handy, because it prevents you from deleting or demoting administrators (including yourself!) by accident.

The line of code you will need to edit is this:

$undeletableusers = '';

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 Import & Maintenance menu on the left of the AdminCP.

126

Chapter 5

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.

127

Administering Your Forum

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.

When you have selected the required options, click on Continue.

128