[daisy] change the default namespace name

shivshan shivshan at hotmail.com
Tue Jan 29 06:13:52 CST 2008


Hi
Am having to do this myself; so do you have any suggestions based on your
experience so far?
Thanks
Shiva


Tom Brusselle wrote:
> 
> Hi,
> 
> i went ahead and tried my quick hack solution.  This is what i did:
> 
> 
> 
> service daisy-wiki stop
> service daisy-merlin stop
> 
> #change namespace in database
> mysql -p daisyrepository << EOF
>          update daisy_namespaces set name_='in' where id=1;
> EOF
> 
> #change namespace in myconfig.xml
> vi /var/daisy/data/conf/myconfig.xml
> --> change default namespace
> 
> #change documentid's of navigationpages and homepages for all sites
> vi /var/daisy/wikidata/sites/*/siteconf.xml
> -->change <navigationDocId> and <homepageDocId>
> 
> #replace all daisy links on all pages (in all versions)
> for i in `find /var/daisy/data/blobstore -type f`
> do
>          sed -r -i "s/daisy:([0-9]+)-www/daisy:\1-in/g" $i
> done
> 
> #replace all links in navigationtrees
> for i in `grep -R -F -l "navigationTree" /var/daisy/data/blobstore* `
> do
>          sed -i -r 's/id="([0-9]+)-www"/id="\1-in"/g' $i
> done
> 
> service daisy-merlin start
> service daisy-wiki start
> 
> 
> 
> 
> Everything seems to work as far as i can see, but i'm still reluctant to 
> apply this on a production system.  Would this cause any problems that 
> any of you can see?  Are there any references stored anywhere else 
> (files or database) that i should adjust?  Or should the above work 
> without further problems?
> 
> If someone can confirm that this should work without further problems 
> i'd be happy to put it on a wikipage on the site so others can benefit.
> 
> cu,
> 
> Tom
> 
> 
> 
> 
> Tom Brusselle wrote:
>> Hi,
>> 
>> We use a daisy template installation that we copy to install different
>> daisies.  Now I've realized that we won't ever be able to migrate
>> documents between any of these daisies because they all have the same
>> namespace id (and even the same fingerprint).  So I would like to change
>> the name (and id) of the default namespace of a daisy repository that
>> already has documents in it, including the namespace of the already
>> existing documents.  There are no imported documents or other namespaces
>> present in the repository.
>> 
>> I've nosed around a little and i think this might work:
>> 1) change the "name_" and "fingerprint" values of the existing namespace
>> in the "daisy_namespaces" table in the database;
>> 2) change the default namespace in myconfig.xml
>> 3) change all links in all daisy documents that link to other daisy
>> documents to replace the existing namespace in the link with a new one
>> (the new default namespace)
>> 
>> 
>> External links to pages in this daisy don't exist yet so the fact that
>> all the links will change isn't a problem for me.  But there are links
>> within the existing daisy documents that will have to be changed.  There
>> is already a docid_convertor tool present for upgrading daisy 1.5 to
>> 2.0, right now it converts all daisy links without a namespace to links
>> with a namespace.
>> I think it would be a relatively small adaptation to make it possible to
>> run this tool on all documents to change one namespace to another
>> namespace in all daisy links.  (i haven't looked at the code)
>> This way one could change the namespace of a daisy instance at any time
>> if a namespace conflict occurs.
>> (The only remaining disadvantage would be that all externally saved
>> links would become invalid.  But then you could create an apache url
>> rewrite or possibly implement some sort of deprecated-namespace-redirect
>> in daisy itsef to solve that)
>> 
>> 
>> Another question: in absense of the adapted docid convertor tool, would
>> the following sysadmin hack work to change all links?  (pseudocode)
>> - stop the repository
>> - for every file in the blobstore:
>> -- s/daisy:(\d+)-old/daisy:\1-new/g  (substitute all entries of the form
>> daisy:123-old to daisy:123-new)
>> 
>> or would this horribly corrupt something?
>> 
>> 
>> thanks very much in advance for you answers,
>> 
>> Tom Brusselle
>> 
>> 
>> **** DISCLAIMER ****
>> http://www.schaubroeck.be/maildisclaimer.htm
>> _______________________________________________
>> daisy community mailing list
>> Professional Daisy support: 
>> http://outerthought.org/site/services/daisy/daisysupport.html
>> mail to: daisy at lists.cocoondev.org
>> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
>> 
> 
>  **** DISCLAIMER ****
>  http://www.schaubroeck.be/maildisclaimer.htm
> _______________________________________________
> daisy community mailing list
> Professional Daisy support:
> http://outerthought.org/site/services/daisy/daisysupport.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
> 
> 

-- 
View this message in context: http://www.nabble.com/change-the-default-namespace-name-tp10602962p15158041.html
Sent from the Daisy - General mailing list archive at Nabble.com.



More information about the daisy mailing list