MyBB Community Forums

Full Version: Static archive of a user’s posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After 10 long years I'm shutting down a community forum, and while I've resorted to wget to export a static archive of the whole forums, I'd like to offer the users with the option to export and take away their own data as well. Granted, taken out of context they're not of much use, but I think it'd be a nice memento to keep.

Ideally what I'm asking for is a PHP script that creates a single .html file containing all of their posts in reverse chronological order, including the time and thread they created or replied to.


Thank you for your time.

Of course being able to also export your Private Messages in that archive, would be a welcome bonus!
Either way… since this thread is most likely going to get some links from search engines sooner of later, here's a few SSH commands to help with turning your MyBB forum into a static archive:


wget --mirror -P static-forum -nH -np -p -k -E --cut-dirs=2 -nv "http://website.com/forums/archive/"


rename 's|index.php\?||g' *.html

find ./ -type f | xargs sed -i 's|http://website.com/forums/|#|g'
find ./ -type f | xargs sed -i 's|index.php%3F|./|g'
find ./ -type f | xargs sed -i 's|#index|index.html|g'
find ./ -type f | xargs sed -i 's|index.php|index|g'
find ./ -type f | xargs sed -i 's|Powered By <a href="http://mybb.com">MyBB</a>, &copy; 2002-2016 <a href="http://mybb.com">MyBB Group</a>||g'

If you're feeling the very least confident with SSH and the terminal you can eventually figure out what the above do. If you don't, then should be looking for another solution. I suggest to use the "Lite Mode" for your archive; better images and less things to break. Feel free to refer to wget's documentation if you're feeling unsafe with the flags: http://www.computerhope.com/unix/wget.htm