AW: [opencms-dev] Changing a Sites Hostname

Simon Wilks simon.wilks at silion.ch
Tue Feb 20 15:44:08 CET 2001


Hi all,

Just in case anyone comes up with the same problem, I have written a little
java (JDK1.1.7) program that will scan the DB for all occurances of string A
and replace it with string B. You can then change things such as the servlet
URL that is hard-coded with the images. You can then develop on one system
and move the site to another system later on.

Nice and dangerous! But if used the right way it successfuly allows you to
do site wide search and replace. It's small and dirty (I was in a hurry),
but if anyone needs it you can have it, use it at your own risk! If used
incorrectly it will ruin your OpenCms DB.

Regards,

Simon Wilks
Software Engineer
simon.wilks at silion.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
silion (switzerland) ag    software engineering
spinnereistrasse 8              9008 st. gallen
tel 0878 80 90 60             fax 0878 80 90 30
info at silion.ch                    www.silion.ch

a member of the Penta Group   www.pentagroup.ch



> -----Ursprüngliche Nachricht-----
> Von: owner-opencms-dev at www.opencms.com
> [mailto:owner-opencms-dev at www.opencms.com]Im Auftrag von Andreas
> Schouten
> Gesendet: Dienstag, 20. Februar 2001 10:14
> An: 'opencms-dev at www.opencms.com'
> Betreff: AW: [opencms-dev] Changing a Sites Hostname
>
>
> Yes, it's planned.
>
> -----Ursprüngliche Nachricht-----
> Von: Simon Wilks [mailto:simon.wilks at silion.ch]
> Gesendet: Dienstag, 20. Februar 2001 09:43
> An: opencms-dev at www.opencms.com
> Betreff: AW: [opencms-dev] Changing a Sites Hostname
>
>
> Thanks Andreas,
>
> When you say "the page-editor should", does that mean it doesn't at the
> moment but it is planned?
>
> I will write a migration tool and post (a link) to it later.
>
> Thanks,
>
> Simon Wilks
> Software Engineer
> simon.wilks at silion.ch
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> silion (switzerland) ag    software engineering
> spinnereistrasse 8              9008 st. gallen
> tel 0878 80 90 60             fax 0878 80 90 30
> info at silion.ch                    www.silion.ch
>
> a member of the Penta Group   www.pentagroup.ch
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: owner-opencms-dev at www.opencms.com
> > [mailto:owner-opencms-dev at www.opencms.com]Im Auftrag von Andreas
> > Schouten
> > Gesendet: Dienstag, 20. Februar 2001 09:32
> > An: 'opencms-dev at www.opencms.com'
> > Betreff: AW: [opencms-dev] Changing a Sites Hostname
> >
> >
> > Hi,
> >
> > the best way is to use the following template-method:
> >
> > <method name="getServletPath"/>
> >
> > this method returns always the correct path eg:
> > http://www.mysite.com/servlets/opencms/ .
> >
> > Yes, the page-editor should insert that.
> >
> > Regards,
> >
> > Andreas Schouten
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Simon Wilks [mailto:simon.wilks at silion.ch]
> > Gesendet: Dienstag, 20. Februar 2001 09:33
> > An: opencms-dev at opencms.com
> > Betreff: [opencms-dev] Changing a Sites Hostname
> >
> >
> > Hi,
> >
> > I was wondering how I go about handling the change of a site's
> > base url with
> > OpenCms. The problem is that when I place an image into a page using the
> > DHTML Editor, the link is always automatically converted to the
> > entire url,
> > ie: http://localhost/opencms/pics/image.gif . When the base URL
> > of the site
> > changes from say http://localhost to http://www.mysite.com all of those
> > pages with images in them need updating.
> >
> > I see only two options at the moment:
> >
> > 1) Write a small program that will scan through the HTML in the cms_???
> > (forgotten already) table and do a search replace; or
> > 2) Export the site, unzip it, do a text based search replace with an
> > apropriate tool, rezip and import.
> >
> > Mmmm. Is there a better way? Is there any way of forcing the
> > system to store
> > relative URLs instead of the entire site URL?
> >
> > If anyone already has a java program to do 1) above I'd love a copy.
> >
> > Simon Wilks
> > Software Engineer
> > simon.wilks at silion.ch
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > silion (switzerland) ag    software engineering
> > spinnereistrasse 8              9008 st. gallen
> > tel 0878 80 90 60             fax 0878 80 90 30
> > info at silion.ch                    www.silion.ch
> >
> > a member of the Penta Group   www.pentagroup.ch
> >




More information about the opencms-dev mailing list