Modern Forum Choices, and Migrating from Discuz to NodeBB
After Discuz ceased updates, alternative forum choices were needed. I’ve experimented with several. Here’s a brief overview of my impressions and migration methods.
Listed below in order of GitHub ranking.
discourse
This is the top-ranked forum, but it’s based on RoR (Ruby on Rails). RoR has poor performance and high memory usage, making it unsuitable for small sites, so I dismissed it outright.
We’ve had several RoR sites taken down by crawlers before; it’s simply too costly to use.
flarum
The interface is very nice. Based on PHP+MySQL, performance shouldn’t be a major issue in theory. However, the forum’s SQL queries aren’t optimized. Accessing the initial posts on an empty forum results in about 100 SQL queries, with page load times starting at 100ms. With a low-end cloud database, 200ms is normal. Combined with other loading elements, the wait time can approach 1 second.
nodebb
This one is built with NoSQL+Node.js, offering strong performance and low CPU usage. It also uses WebSocket long connections, resulting in very fast response times. Memory usage starts at 1GB but grows slowly. I chose this because of its comprehensive plugins and API.
apache / answer
This is also excellent, similar to Zhihu/StackOverflow. However, I couldn’t find a way to remove features like “asking questions” and “accepting answers.” If those could be removed, it would become an article (long-form main post) centered forum, suitable for guide-oriented forums that don’t require extensive interactive features.
flaskbb / flaskbb
A Python-based forum with good performance, but it hasn’t been updated for a long time.
rafalp / Misago
Looks like an anime-style forum at first glance, also Python-based. The author started development not many years ago but is quite diligent. I noticed they use Python’s SocialAuth library, which allows easy integration of QQ, WeChat, Google, and other login methods, including integration with your own website.
Additionally, there are two Chinese-made forums that look promising: one is Casbin, a high-fidelity clone of v2ex; the others are bbs-go and symphony, which resemble CSDN’s blog format. I haven’t tested these.
Migrating from Discuz to NodeBB
If you have your own website, NodeBB migration authentication can use these two official plugins: nodebb-plugin-session-sharing or nodebb-plugin-sso-oauth2-multiple.
As for importing from Discuz, you’ll have to write your own code. Use AI to help you write a Python framework, then modify the rest yourself.
If you only need to import posts, loop through Discuz’s posts table. Each row is a post, and first=1 indicates a topic post.
For topic posts, call NodeBB’s api/v3/topics/ endpoint. For replies, call the api/v3/topics/{tid} endpoint. For users, you can use the user creation endpoint. Since I used session-sharing, I used the api/session-sharing/user endpoint for creation and api/session-sharing/lookup?id={passport_id} for lookup.
The API processing speed is about 5 requests per second, so be prepared for a slow migration.
Example call:
async def create_topic(title, body, timestamp, category, tags, uid):
# Create topic POST
data = {
"cid": category, # Category ID
"title": title,
"content": body,
"timestamp": int(timestamp), # Timestamp in milliseconds
"tags": tags,
"_uid": uid # Poster's UID
}
# API admin key
headers = {"Authorization": f"Bearer 1239383-3323-2323-2323-asd123123123"}
# Call
async with aiohttp.ClientSession() as session:
async with session.post(
'https://xxx.com/api/v3/topics/',
headers=headers,
json=data
) as response:
if response.status != 200:
# If the error is like "Please add content, cannot be less than 1 character", the content wasn't escaped.
response_text = await response.text()
raise Exception(f"Error creating topic {title}: {response_text}")
result = await response.json()
topic_object = result['response']
return topic_object['tid']Note: API posting follows the same logic as user posting and is subject to all forum character limits. Similarly, the timestamp parameter is often ignored and the post will be published with the current time. The solution is to modify line 16 in src/api/helpers.js. Simply comment out the line data.timestamp = Date.now();. Remember to revert this change after migration, otherwise users could also modify timestamps.
After making this change, the reply API endpoint api/v3/topics/{tid} will also support passing a timestamp to specify the time.
b96cfe3