Pierre LINDENBAUM wrote:
Hi all,
Hi all, I'm working with the mediawiki API and I would like to 'truncate' the mysql tables in order to reset my local installation while keeping the users.
What would be the SQL queries ? I would say: tuncate all the tables but ${PREFIX}_user and update ${PREFIX}_user set user_editcount=0 ? Any other(safer) suggestion ? Thank you in advance Pierre
You may not want to truncate user_properties. Doing that would reset everybody to default preferences. user_groups holds which users are sysops, which bureaucrats... so don't truncate that either. The site_stats table contain coutners for users but also for pages and views. I think they would recompute automatically but you can change the values manually. Since you're keeping users, keeping blocks could also be desirable (ipblocks). If you truncate the logging table, you will lose information for user creation and blocks (you'd need to delete some types only).
It is not needed, but you can keep the math table. The tables interwiki and updatelogs wouldn't really need new values for the new wiki.
It's ok to truncate the othe tables: user_newtalk, page, revision, text, archive, pagelinks, templatelinks, imagelinks, categorylinks, category, externallinks, langlinks, hitcounter, watchlist, image, oldimage, filearchive, recentchanges, searchindex, interwiki, querycache, objectcache, log_search, trackbacks, job, querycache_info, redirect, querycachetwo, page_restrictions, protected_titles, page_props, change_tags, tag_summary, valid_tag, l10n_cache.