Hello, I have recently had the interesting experience of not migrating an old geoserver to a new instance but *merging *an old GeoServer with another, newer already active Geoserver that had some duplication with the old GeoServer.
I was able to transfer all the styles by removing the workspace reference <#styles>Styles *For styles OUTSIDE of any workspace* we manually delete all of the styles that we do not want. Then we synch the files cd /mnt/tmp/geoserver/tran/styles/rm tmp*rm *.bakrsync -a -v --ignore-existing /mnt/tmp/geoserver/tran/styles/* /mnt/geoserver/data/styles/.systemctl restart tomcat *For workspace specific styles* we need to remove the reference to the workspace from the xml file. cd /mnt/tmp/geoserver/tran/workspaces/workspace_name/stylesrm tmp*rm *.baksed -i '/<workspace>/,/<\/workspace>/d' *.xml (PS yes I did read the many warnings about NOT using a regex with sed on xml files. . . . but it worked ;-) cd /mnt/geoserver/data/stylestar -cvpzf styles_bk.tar.gz *rsync -a -v --ignore-existing /mnt/tmp/geoserver/tran/workspaces/workspace_name/styles/* .systemctl restart tomcat LayersUnfortunately I was not able to transfer our 400 layers. I tried the import extension and unfortunately I got an error with this tool (email to follow). The reason I was not able to transfer the layers was because the workspace and store ID's saved in the layer xml files were of course not matching my new instance. The styles should have been alright. Because we needed to "just get it done" we manually transferred the layers. However, I am wondering if there are other tools or other methods I should have used? not sure if replacing everything with scripts is an approach I should explore, even though the structure of the data is very transparent (I love geoserver) In hindsight (now that it is no longer 2 am) I should have perhaps done something like this: *To Try Next Time* Prior to backing up the GeoServer rename all of the work spaces and stores to indicate the server name Try merging all of these: - workspaces - stores - styles (see below) - then finally layers Theoretically if we migrate all of these then the layers should work because the workspace, store, and style ID's will exist in the new instance. I did find this command supper useful since there was some duplication between the two GeoServers: rsync -a -v --ignore-existing src dst Your thoughts appreciated, for next time . . . Vera
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users