Pergunta

is it possible to export layer configurations from geoserver and import them into geoserver on another computer? It takes a long time to keep setting up the layers everytime i switch computers.

Foi útil?

Solução

Apparently you cant..The only way is to copy the data_dir directory and replace the new installations data_dir. Then when you start up geoserver the layer configs you setup should load automatically.

Outras dicas

You could use the Geoserver Manager1 (a wrapper around the Geoserver rest-api), to configure your layers, and store the procedure. Then you could just point the Manager to the new Geoserver.

For the migration of Geoserver 2.x to Geoserver 2.y (using Tomcat):

  1. Make a backup of your directory "data" of Geoserver 2.x.

  2. Stop Geoserver 2.x in Tomcat and then, stop Tomcat (sudo /etc/init.d/tomcatx stop).

  3. Remove (a backup is best) your directory "geoserver" of "webapps". (generally is tomcatx/webapps).

  4. Install the new version of Geoserver (in this case Geoserver 2.y). If you are using Tomcat, you could use the war file.

  5. Edit the file "web.xml" (tomcatx/webapps/geoserver/WEB-INF/web.xml) whit the new path. For example:

    <context-param>
        <param-name>GEOSERVER_DATA_DIR</param-name>
        <param-value>/var/lib/tomcatx/webapps/geoserver/data</param-value>
    </context-param> 
    

to

    <context-param>
        <param-name>GEOSERVER_DATA_DIR</param-name>
        <param-value>new-path-of-data</param-value>
    </context-param> 
  1. Move your new directory "security" to other place (usually is tomcatx/webapps/geoserver/data/security).

  2. Change permissions of your data directory to tomcatx. (chgrp, chown)

  3. Restart Tomcat.

Regards.

Geoserver 2.x is old version.

Geoserver 2.y is new version.

tomcatx is your version of Tomcat.

1.copy folder "data" in geoserver to on another computer and replace it to .war and geoserver folder

2-dump database old to new computer 

3-restart tomcat

/etc/init.d/tomacat7 restrat

4-change owner "data" on geoserver to  tomcat user 

-cd to /var/lib/tomcat7/webapps/geoserver sudo chown -R tomcat7 data sudo chown -R :tomcat7 data

5-reload store on geoserver
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top