Migrating from KnowledgeTree to SeedDMS   September 24th, 2018

For many years, I had an installation of KnowledgeTree for our small charity “Nazareth Kinderheim Kenia e.V.”.

Unfortunately, it has not been maintained anymore for many years, and the replacement of PHP5 with PHP7 forced me to do something.

I finally settled for SeedDMS as a replacement, and I really like it!

See instructions how to install SeedDMS in a shared hosting environment, at Hostsharing: https://wiki.hostsharing.net/index.php?title=SeedDMS_installieren (in German).

To export the files from KnowledgeTree, I made the decision, that I would ignore deleted files, and would not need the history of files, so only the latest version of each file. That made the migration much easier.

I found a Python script by Ben E. C. Boyter at https://boyter.org/2015/09/exporting-documents-knowledgetree-3-7-0-2/ which was a good start. I found only two issues with it: it would restore even deleted or archived files, and it would restore a random version of a file, not the latest version. So I fixed the Python script, and you can see it here as a gist: https://gist.github.com/tpokorra/71526bc60ced2649dba2c528d5cd2259

There is an import function in SeedDMS, where you can import from a directory on the server, which minimizes the used bandwidth. Alternatively, you can use WebDAV to import a lot of files at the same time.

 

Tags: , , ,
Posted in Hosting | Comments Closed

Knowledge Tree and PHP 5.3.3   March 7th, 2011

We have got the latest PHP version on Hostsharing, and Knowledge Tree 3.7.0.2 did not work anymore.

I got a long list of deprecated warnings, and the session would not even start, so not even a login screen is displayed.
Deprecated: Assigning the return value of new by reference is deprecated
Warning: The magic method __get() must have public visibility and cannot be static
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent
The solution is to edit config/dmsDefaults.php, find the lines containing
error_reporting(E_ALL & ~E_NOTICE);
ini_set(‘display_errors’, ‘1’);
ini_set(‘display_startup_errors’, ‘1’);
Below that, add the following line:

error_reporting(0);

Now Knowledge Tree 3.7.0.2 will work again, and hopefully the next version of Knowledge Tree will have fixed all the deprecated PHP things.

The advantage of KnowledgeTree is that it keeps versions of each document that you upload. Unfortunately, this does not seem to work in version 3.7.0.2, when uploading a new version of an existing file via WebDAV. The file is overwritten with the new version, but there is no version history.

There might be good reasons for that behaviour, which are explained in this issue?

Here is a solution that works for me, but of course, I do not know the interna of Knowledge Tree, therefore please use it at your own risk…
In file ktwebdav/lib/KTWebDAVServer.inc.php, find the lines:
// Modified – 25/10/07 – changed add to overwrite
// $oDocument =& KTDocumentUtil::add($oParentFolder, $name, $oUser, $aOptions);
$oDocument =& KTDocumentUtil::overwrite($oDocument, $name, $sTempFilename, $oUser, $aOptions);
It seems, with the add method a new file would be created, with a unique filename. So uploading a new version of test.txt would result in two files, test.txt would stay, and the new file would be test(1).txt. This is not really what you want.
To get real versioning, comment that line with “overwrite”, and add these lines:
$aOptions[‘newfilename’] = $name;
$oDocument =& KTDocumentUtil::checkin($oDocument, $sTempFilename, ‘WebDAV upload’, $oUser, $aOptions);
This should do the trick. You will only have one file in your folder, and when you click on “Version History” in your webinterface, you will see the old versions and the current version. The file you download via WebDAV is always the latest version. This makes sense to me…