[dokuwiki] Doing something to on all files in the wiki
- From: "Daniel Mitchell" <DanielMitchell@xxxxxxxxxxxxx>
- To: <dokuwiki@xxxxxxxxxxxxx>
- Date: Tue, 24 Oct 2006 17:35:08 -0600
There's been a change in location of some files on our network, so a
change needed to be made to a string in every page in our wiki. There's
somewhere between 250 and 300 files (out of 1900) that need changing, so
it's a bit laborious to do this manually. I want to preserve history and
lockfiles and stuff -- there's dwpage.php to do this, but that's a bit
awkward from a shell prompt, because dwpage.php takes page names in wiki
format, not in path format. My current plan is something along these
lines:
Firstly, get a list of all the page names.
for x in `find /www/html/wiki/data/pages -name "*.txt"`; do echo
${x%.txt} | tr "//" ":" | cut -c 26- >> filelist; done
Secondly, for all those files, check the file out to somewhere
temporary, do the required sed, then check it back in again.
for x in `cat filelist`; do /www/html/wiki/bin/dwpage.php checkout $x
tmp.txt; sed -e "s/calfs1\\\\docs/calfiles\\\docs/g" -i tmp.txt;
/www/html/wiki/bin/dwpage.php -m "changing calfs1 to calfiles" commit
tmp.txt $x; done
This seems to have worked, sort of -- all the files have changed, but
there's nothing showing up in the history for the changed files. What's
likely to go wrong as a result of this? What is the purpose of the -m
argument to dwpage.php, given it just gets discarded?
(dokuwiki v206-03-09)
-- dan
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
Other related posts:
- » [dokuwiki] Doing something to on all files in the wiki