Reputation: 962
is there a way to clean, delete all the wiki pages so i can have a clean index, with only the pages i have created ?
Upvotes: 1
Views: 1425
Reputation: 2390
Precaution: Make a verified-good backup before, the cleanup of user changes to standard pages is final *).
Provided you can gain direct db access you should type the following simple SQL statement:
SELECT name FROM wiki WHERE author='trac';
It returns names of all wiki pages
You may change, i.e. exclude some pages by extending the statement with further conditions in appropriate SQL syntax.
When a SELECT returns exactly the pages you're after, all you have to do is changing the same statement into a DELETE:
DELETE FROM wiki WHERE author='trac';
All but your custom wiki pages will be gone this second.
*) Original content could still be restored at any time by just executing the following command in a terminal session with appropriate permissions:
trac-admin <env> wiki upgrade
Upvotes: 2
Reputation: 1127
If you use sqlite as database (standard for trac). Use this command to delete wiki entries with author trac:
sqlite3 /your/path/to/trac.db "DELETE FROM wiki WHERE author='trac'"
Upvotes: 0
Reputation: 9
You may simply execute:
$ trac-admin /path/to/trac wiki remove *
If you want to be more selective using a graphical tool, you can use sqlitebrowser available for both linux and windows.
Upvotes: 0
Reputation: 19940
You can hack around trac-admin like this:
#!/bin/sh
# extract the page list from trac (this filter matches only CamelCase words or numbers,
# it will blow if there are pages which does not fit into this scheme)
for site in `trac-admin /path/to/trac wiki list | sed -e 's/\([a-zA-Z0-9]*\).*/\1/'`
do
# and remove every single page
trac-admin /path/to/trac wiki remove $site
done
Upvotes: 3