pchan
Hi, I wish to evaluate DokuWiki for heavy uses (up to 100,000 pages).
Namespaces is the solution to this situation. Now once the pages are so structured,
are there tools to restructure them easily ?
E.g. Change references in all pages from x:subject to y:subject ?
Maybe it's easy to build such a plugin (which will take time to run, ok).
falkor
If you are inserting the pages into a new installation dokuwiki (not moving them around),
one can easily make a perl-script that will do this for you.
I'm assuming that each file has either in content or in filename an indication of what namespace they should be moved.
Let's say the files have names in the following structure: "namespace-title.txt". A _sample_ script that would do the job is:
#!/usr/bin/perl -w
use strict;
use File::Copy;
my @files = <*.txt>; #Assuming that's how they're named.
foreach(@files){
my ($ns, $title) = split(/-/, $_);
if(!-d $ns){
mkdir($ns);
}
move($_,$ns."/".$title);
chmod(0775, ); #you can give stricter permissions if you share a group with the webserver. Alternatively,
#comment out the line and run the script as the web server (can be very dangerous).
}
Please bear in mind that this is just a quick script - DO NOT USE IT AS IS.
It will not honor that the file in the namespace already exists.
It will not make any changes to a file other then creating dirs or renaming.
It cannot make subdirs, this functionality is something you must add (recursive for example).
It will not understand if you go over the file limit of the fs (it will probably just crash).
The reason it works is because dokuwiki allows you to just drop new files in the folders (as long as you give dokuwiki permission to
access them).
If you want to change all references, you have to read each file and substitute (either with perl or some other unix tools like cat+awk).
There is already a plugin for this, but it only does single files. It's source can defintely give you inspiration tho ;-)
Good luck,
//Falkor