Repository navigation
Admin Maintenance
This page covers the clean-up and maintenance tools of YAF.NET: removing old topics and private messages, the recycle bin of deleted topics and posts, the event log, and the database tools of the host admin.
| Page | Menu | Who |
|---|---|---|
| Prune Topics | Admin > Maintenance > Prune Topics | admins with access to the page |
| Restore & Delete Topics | Admin > Maintenance > Restore & Delete Topics | admins with access to the page |
| Private Messages | Admin > Maintenance > Private Messages | admins with access to the page |
| Event Log | Admin > Maintenance > Event Log | admins with access to the page |
| DB Maintenance | Host > Database > DB Maintenance | host admin only |
| Run SQL Query | Host > Database > Run SQL Query | host admin only |
| Database Backup | Host > Database > Database Backup | host admin only |
| Restart App | Host > Restart App | host admin only |
The host admin can always open the admin pages. Other admins need access to each page, which the host admin grants under Host > Admin Page Access (see Admin Page Access). The Maintenance menu also contains Attachments and Tags, see Content.
All the pages work on the board you are on, except the database pages and Restart App, which affect the whole installation.
Deletes old topics in one go, e.g. to clean up an archive forum. Admin > Maintenance > Prune Topics
| Field | Description |
|---|---|
| Forum: | The forum to prune, or All Forums of the board. |
| Enter minimum age in days: | Topics whose last post is older than this are deleted. Default 60, at least 1. |
| Permanently remove from DB: | Off (default): the topics are only flagged as deleted and go to the recycle bin (Restore & Delete Topics), where you can restore them. On: the topics and their posts are removed from the database and can't be restored. |
Click Start Prune Task and confirm. The prune runs in the background ("Prune Task Scheduled"); while it runs the page shows that a prune is running and you can't start a second one. The number of pruned topics is written to the log.
Not pruned are:
- sticky topics and announcements,
- persistent topics (admins and moderators can mark a topic as persistent when they create or edit it),
- topics in inactive categories.
Tip
Prune without Permanently remove from DB: first, check the result in the recycle bin, and then delete the topics for good there.
Note
The confirmation says the process is irreversible. That is only true with Permanently remove from DB:; otherwise the topics can be restored.
The recycle bin of the board. When a user, moderator or admin deletes a topic or a post, it is only flagged as deleted and stays here until you restore it or delete it for good. Admin > Maintenance > Restore & Delete Topics
The page has two tabs.
- Search by Topic Name and Search filter the list.
- Restore Topic restores the topic and its first post. It is only offered for topics that still have posts.
- Delete for good removes the topic and its posts from the database.
- Delete All > Delete All deletes all topics of the list (with a search text: only the found topics) for good.
- Delete All > Delete all with 0 Posts deletes all deleted topics without posts for good.
Each deleted post is shown with its forum, topic, date, an excerpt and the reason given when it was deleted.
- Restore Message restores the post.
- Delete for good removes the post from the database.
- Delete All deletes all deleted posts of the board for good.
Deleting for good can't be undone.
Note
Whether users see a note in place of a deleted post is set in Host Settings > Display (Show Deleted Messages:).
Deletes old private messages of all users of the board, to keep the database small. Admin > Maintenance > Private Messages
The page shows the number of private messages of the board. Enter the age in Delete messages older than: (default 180 days, at least 1) and click Delete. After the confirmation all private messages older than that are deleted for all users of the board (sent and received, read or not), and the page shows how many were deleted. This can't be undone.
The log of the forum: errors, warnings, information, failed logins, bans, deleted and suspended users, and the spam checks. Look here first when something goes wrong. Admin > Maintenance > Event Log
The spam related entries are also shown on their own page, Admin > Spam Protection > Spam Event Log (see Protect YAF.NET against spam bots).
- Start Date and End Date, then Apply: the period to show. By default the last 365 days (the Max number of days for event log of the host settings).
- The type buttons above the list show how many entries of each type the period has. Click a type to show only these entries, All types to show all again.
- Show: sets the number of entries per page.
The types are:
| Type | Written when |
|---|---|
| Error, Sql Error | an error occurred (the entry contains the error message and the stack trace) |
| Warning, Information, Debug, Trace | the application writes a warning or an information, e.g. a task was finished |
| Login Failure | a login failed |
| User Suspended, User Unsuspended, User Deleted | a user was suspended, un-suspended or deleted |
| Ip Ban Set, Ip Ban Lifted, Ip Ban Detected | an IP address was banned or un-banned, or a request of a banned IP address, country or user agent was blocked |
| Spam Bot Reported, Spam Bot Detected, Spam Message Reported, Spam Message Detected | the spam checks found a bot or a spam post, or a spammer was reported |
Which types are written is set in Host Settings > Logs (Log scope).
Each entry shows the type, the source, the time and the user (if any) with a summary. Show opens the details: the message, the IP address of the user (a link to the IP info page), the address of the request, the browser (user agent) and, for errors, the exception and the stack trace. Copy to clipboard copies the entry, e.g. to post it in the support forum.
- Delete at an entry deletes this entry.
- Clean Up deletes all entries of the board (after a confirmation).
You don't have to clean up by hand: the log keeps at most Max event log messages entries (default 1050) for at most Max number of days for event log days (default 365); older entries are deleted when the page is opened. Both are set in Host Settings > Logs.
Tools to keep the database fast and small. Host > Database > DB Maintenance, host admin only.
The header shows the database server and the size of the database. The tools:
| Tool | What it does |
|---|---|
| Table index statistics (Show) | Shows how fragmented the tables and indexes are. |
| Reindex tables | Rebuilds the indexes of the tables, which makes queries faster after many changes. |
| Shrink database | Frees unused space and reduces the size of the database files. The new size is shown afterwards. |
| Recovery mode (Set recovery mode) | SQL Server only: sets how the transaction log is kept, see below. |
Each tool asks for a confirmation. The operations can make the database slow or unavailable for a moment, so run them when the forum is quiet. If the database user of the forum is not allowed to run an operation, the error of the database is shown.
What each database does:
| Database | Table index statistics | Reindex tables | Shrink database |
|---|---|---|---|
| SQL Server | fragmentation of each index |
DBCC DBREINDEX of the YAF tables |
DBCC SHRINKDATABASE |
| MySQL / MariaDB | size, free space and fragmentation of each table |
OPTIMIZE TABLE of the YAF tables |
OPTIMIZE TABLE of the YAF tables (same as reindex) |
| PostgreSQL | estimated bloat of each table | REINDEX DATABASE |
VACUUM |
| SQLite | not supported | REINDEX |
VACUUM |
The Recovery mode box is only shown for SQL Server:
| Mode | Description |
|---|---|
| Full | Every transaction is logged; the database can be restored to any point in time. The log grows until it is backed up, so use it only if you back up the transaction log. |
| Simple | The log is cleared automatically; the database can only be restored to the last full backup. A good choice for most forums. |
| Bulk-Logged | Like Full, but bulk operations are logged minimally. |
Tip
Don't shrink the database regularly on SQL Server: it fragments the indexes, and the files grow again. Reindex after a shrink.
Runs SQL statements directly on the database of the forum. Host > Database > Run SQL Query, host admin only.
Warning
The statements run immediately, without a transaction and without a second confirmation. An UPDATE or DELETE without a WHERE, or a DROP, can destroy the forum for all boards. Make a backup first and test your query with a SELECT.
- Type the SQL in SQL Command:.
{objectQualifier}(the table prefix, by defaultyaf_) and{databaseOwner}are replaced with the values of your installation, e.g.SELECT COUNT(*) FROM {databaseOwner}.{objectQualifier}Useron SQL Server. - Click Run Query (or press Ctrl+Enter).
- The Result shows each result set as a table with the number of rows (at most 1000 rows per result set are shown), the number of records an
INSERT,UPDATEorDELETEaffected, or the error message of the database.
The SQL must be written for your database (SQL Server, MySQL, PostgreSQL or SQLite).
The forum can back up its database and files itself, on demand or every night. The page Host > Database > Database Backup is only shown when a backup is possible on your server; Host > Host Settings > Server Info shows why not. See Database Backup.
Stops the application so that it starts again, e.g. after you changed appsettings.json or replaced files. Host > Restart App, host admin only.
Click Restart Application on the page. The page shows that the application is restarting and reloads itself once the forum is available again.
Warning
All boards are restarted. Until the application is running again, the visitors of all boards get an error page, and a post that is sent during the restart is lost.
The forum only stops itself; starting it again is the job of the hosting environment. IIS starts it with the next request, a Windows Service, systemd or Docker (with a restart policy) start it automatically. If the forum runs without such a manager (e.g. started by hand with dotnet), the page tells you after a while that the application did not come back, and you have to start it manually.
Debug builds of YAF.NET have a Test Generator in the Host menu that creates test users, boards, categories, forums, topics, posts and private messages. It is meant for developers and is not available in the release builds.
- Admin guide
- Host Settings (the log settings)
- Database Backup
- Protect YAF.NET against spam bots
- Troubleshooting
YetAnotherForum.NET (YAF) the Open Source Discussion Forum for ASP.NET - https://YetAnotherForum.NET - Support me on Ko-fi
Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
Getting started
- About YAF.NET
- Features
- Docker
- Installation (IIS)
- Hosting on Linux with nginx
- Integration (ASP.NET Core)
- Update v4 to a newer v4
- Upgrade from v3 to v4
Configuration
Administration
- Admin guide
- Forums and categories
- Users, roles and permissions
- Board settings
- Host settings
- Content
- Mail and notifications
- Spam protection
- Maintenance
- Boards, languages, page access
- Database backup
- Private forum
- Change the board logo
- Themes
Help
Development
Legacy (v3 and older)