exporting layer configurations from geoserver
Asked Answered
T

4

7

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.

Thorn answered 21/5, 2011 at 0:38 Comment(0)
T
10

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.

Thorn answered 24/5, 2011 at 18:40 Comment(2)
On a machine with new install of geoserver layers with encrypted passwords stored in the data_dir will not load correctly.Inexpressible
"Should" being the operative word. I have had lots of issues over the years with this. Always make a basic "copy" backup before upgrading. I have also started using multiple instances each with their own subset of layers. Minor errors seem to build up over time and when frequently editing lots of layers, it can be hard to narrow down to a single problematic one. With small instances, it is not a big deal to bring them in one at a time to a new instance and then destroy the old.Vela
M
2

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.

Mouser answered 25/1, 2012 at 8:27 Comment(0)
M
1

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.

Mahan answered 11/3, 2016 at 21:48 Comment(0)
F
0
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
Fitzhugh answered 22/10, 2013 at 7:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.