Hi Vera, you may also want to have a look at the backup and restore plugin: https://docs.geoserver.org/latest/en/user/community/backuprestore/index.html
Kind regards, Nuno Oliveira On Tue, Apr 20, 2021 at 5:37 AM Alexandre Gacon <alexandre.ga...@gmail.com> wrote: > Hi Vera, > > Personnaly I would have tried to use the REST API of geoserver to migrate > the content between the 2 instances. > > Regards > Alexandre > > Le lun. 19 avr. 2021 à 23:48, Vera Green <vera.green...@gmail.com> a > écrit : > >> 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 >> >> <#m_-5820424419311889927_m_793308323945472790_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 >> > _______________________________________________ > 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 > -- Regards, Nuno Oliveira == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Nuno Miguel Carvalho Oliveira @nmcoliveira Software Engineer GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.
_______________________________________________ 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