In this tutorial we will review how to maintain the Simple Machines Forum application. This is a good practise as it will make sure that your website stays optimized properly for better performance and better security.
The maintenance options that you have are:
Step 1 Forum Maintenance
You have different options for the forum maintenance. The first thing to do is to access your SMF installation as administrator. Click on the Admin button from the main menu and then select the Maintenance tab and Forum Maintenance.
The first option you can use for the maintenance of your website is called Routine. It will offer the following:
- Check all files against current versions - Running this task will tell you which of your files need to be upgraded
- Find and repair any errors - Running this task will search for any possible errors in your database. Usually, these errors are caused by improper conversions, modifications gone wrong, or data corruption. It is a good idea to check this once in a while, just in case. Recount all forum totals and statistics - Running this task will recount the number of posts and topics in each board, the number of personal messages each member has, and a few other statistics
- Empty out unimportant logs - Running this task empties a few of the less important log tables. This is not necessary, unless you really want to save database space
- Empty file cache - Running this task will empty out the files generated by SMF for caching purposes
The second tab for the SMF maintenance is for your Database. It offers the following options:
- Optimize all tables to improve performance - Running this task will get rid of overhead, effectively making the tables smaller in size and your forum faster! Note that it causes SMF to instruct the database to attempt to re-analyze and re-optimize the tables in your database, so it is not a good idea to run this too often, because it can take a long time
- Backup Database - This area allows you to save a copy of all the posts, settings, members, and other information in your forum to a very large file. For larger forums, this backup may not be able to backup your entire database, in which case you may want to backup your data by other means, such as using phpmyadmin, or some other database backup utility
- Convert HTML-entities to UTF-8 characters - Running this task will convert your character set for both your database and data to UTF-8. This should be run with caution, as it is not desirable in all cases. Upon clicking this link you will receive more information on the effects of converting to UTF-8. SMF will attempt to detect your character set for your data, but if you know your data character set is different from the one which is detected, you can change it using the dropdown menu next to Data character set. This option is only available if SMF detects a compatible database version
The third option for the maintenance of your SMF website is for the Members. You can do the following:
- Reattribute User Posts - This function assigns a guest's posts to a specific registered user based on the email address or the username used to post
- Remove Inactive Members - This function allows the removal of inactive users. It is possible to delete all users who have not logged in for a defined period of time, or who have not activated the account. It is also possible to select to prune only one or more membergroups
The last option for the maintenance of SMF is for the Topics. You can:
- Remove Old Posts - This allows admins to remove old topics that have not been posted in for the specified number of days. It is possible to narrow down the posts to delete by selecting from removing any type of topic, moved topic notices, or locked topics. The option But don't count stickied topics prevents the removal of topics which have been stickied. Additionally, expanding the All Boards link, and checking boards, will ensure that topics will be removed only from those boards which have been selected. Please note that this is a manual process, so it will not be repeated automatically. Move Topics - This allows you to move all the topics in one board to another
Step 2 Scheduled Tasks
SMF comes with its own version of a scheduler. This is called scheduled tasks. The forum comes with several tasks installed by default, but you may have a greater number, depending on the customizations you have installed. SMF's scheduled tasks rely on people visiting your forum. If you have a busy forum, the tasks will generally be run on time. If you do not have a busy forum, the tasks will be run the next time someone visits your forum.
Tasks are organized by task name, next due, regularity, and enabled. There is also another column for run now which allows you to select tasks to be run straight away instead of their next due time. The task name shows the name and a short description of the task, as well as a link to edit the task. Next due gives you a time based on the server's set time of when this task will be executed. Regularity is how often the task will run when enabled. Enabled is a check box which will enable or disable the task.
The first option that you have is called the Scheduled Tasks. By selecting the task's name on the Scheduled Tasks screen, you will be brought to the edit window. This is where you can change information about the tasks. Remember, all times are based on the server time. The options you have are:
- Task name - The name of the task. Beneath the name is a short description of the task
- Interval - How often the task should be run
- Start time - Time the first instance of the day should start (hours:minutes)
- Enabled - Enable this task to be run
The second option is for the Task Log. It will list the logs of the tasks that have been executed. The list explains which task was run (task name), when it was run (time run), and how long it took to run it (time taken). Take note that all times are based on the server's time, which may be different from the time settings for the member viewing the log.
Congratulations! We have succesfully reviewed how to maintain our SMF application and you will be able to do so on your own for better performance of your website.