Per your message a few weeks ago to Jo, I am in a similar situation but still want to be sure I'm doing this correctly.
I don't know if this changes the steps any but we were moving GN to a new server so my sys admin has already put a copy of GN 2.8 with all my data and system changes (regions/banners/footer etc.) on the new server (calling it geonetwork-old) and an empty copy of GN 2.10 (calling it geonetwork). So I already have two instances running on the same (new) server with my production 2.8 still running on the old server.
Anyway, now I want to migrate/upgrade the new server 2.8 version to 2.10. Should I just tell him to redeploy the 2.10 war or is there something I can do migration-wise with it already in place on the same server?
Kathy
-----Original Message-----
From: Jean Pommier [mailto:jean.pommier@…1328…]
Sent: Wednesday, November 05, 2014 3:37 PM
To: Jo Cook
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] batch import
Hi Jo,
OK, right. Sure, there is room for improvement and Howtos in the current documentation.
But your question here is as much about tomcat than about geonetwork.
_Quick answer : _
- stop tomcat, rename the old webapp, restart tomcat, deploy the new war. You'll have both geonetwork instances working side by side. Should be.
or rename the war file before deploying it. Same result.
- check it works
- stop tomcat, copy the data directory and set the DB (depends which DB you're using). Restart tomcat. The upgrade should perform automatically.
Check the logs to see if everything goes fines.
_More detailed example :_
Here is what I do when I want to perform an upgrade (I'm using war files, on tomcat7) :
- I assume you're using an external DB (postgresql) in my case. I guess with H2 DB, it will be possible too, but I never did.
- If not done, you'd better move your data directory out of the webapp.
See "GeoNetwork Data Directory" here :
http://geonetwork-opensource.org/manuals/2.10.3/eng/users/admin/advanced-configuration/index.html
You have several ways to declare the path to the data directory. I usually do it in my WEB-INF/config-overrides-prod.xml file since it allows me for different setups depending whether I'm working on prod or developing at home.
Here an example of what it could look like (most of it is for the postgresql params. The only one about data dir is in bold):
<overrides>
<properties>
<db.user>geonetwork</db.user>
<db.pass>geonetwork</db.pass> <db.dbname>jdbc:postgresql://localhost:5432/gm_risk</db.dbname>
</properties>
<file name=".*/WEB-INF/config.xml"> *<addXML xpath="appHandler"><param name="geonetwork.dir"
value="/home/jean/tomcat7/data/gm-risk-datadir" /></addXML>*
<replaceXML xpath="resources">
<resource enabled="true">
<name>main-db</name> <provider>jeeves.resources.dbms.ApacheDBCPool</provider>
<config> <user>${db.user}</user> <password>${db.pass}</password> <driver>org.postgis.DriverWrapper</driver>
<url>${db.dbname}</url>
<poolSize>10</poolSize>
<validationQuery>SELECT 1</validationQuery>
</config>
</resource>
</replaceXML>
</file>
</overrides>
If you already have some content, you will of course want to move (or
copy) the WEB-INF/data folder and rename it. In this example, I renamed it to gm-risk-datadir.
.. restart tomcat, and check the changes worked (you'll have the datadir listed in Admin/System Information) Don't forget the access rights. Ideally, tomcat is to be the owner of the datadir.
OK, so now you have data /and/ DB out of your webapp. Not necessary but easier.
- stop tomcat. Change you old app's name (say, geonetwork_old). Restart tomcat. The old app should have now the changed name.
- deploy the new war file
- clone the DB and datadir
- stop tomcat. Adjust your config-override-prod.xml file, on the new geonetwork instance to point to the DB and datadir clones.
- Restart tomcat. check it did find and use the DB and datdir declared on your .xml config file (see Admin/System information page)
- Now you should have 2 instances of geonetwork running alongside and independently : the old one and the new one. And at this point, if the new one works, it should already have upgraded the DB and datadir if necessary.
- Take your time to check everything is OK, and then remove the old app.
If everything is not OK, check the logs.
And of course, before you run this, backup everything, in case I forgot an important step ;o) Have fun !
Jean
Le 05/11/2014 17:42, Jo Cook a écrit :
Hi Jean,
The instructions for "doing an upgrade" are limited at best:
http://geonetwork-opensource.org/manuals/2.10.3/eng/users/quickstartguide/installing/index.html#upgrading-to-a-new-version.
If you are running geonetwork as a war file in tomcat, how can you
upgrade without undeploying the original war file? It seems to me that
creating a new installation and importing the data from one to another
is the only safe way of doing things without risking destroying the
original installation. If there is a better way then the documentation
should be improved to explain it.Jo
<...snip...>