5

I have GeoServer (v2.2 from OpenGeo Suite) running on a test server hosting many different WMS services sourcing many different PostGIS db tables. I want to push this setup onto a production server now but I'm not sure what the best method would be for migrating this info without recreating all the Workspaces, Stores, and WMS layers again.

Both servers are the same:

Windows Server 2008 R2 Standard

My thoughts so far are:

  1. Stop GeoServer on test
  2. Make backup of all dbs in PGAdmin on test
  3. Restore backup(s) to production db
  4. Copy data directory from test and paste it to same location on production
  5. Start GeoServer on production

Thoughts?

Thank you

2

My initial thoughts in my question worked:

  1. Stop GeoServer on test
  2. Make backup of all dbs in PGAdmin on test
  3. Restore backup(s) to production db
  4. Copy data directory from test and paste it to same location on production
  5. Start GeoServer on production
1

Looking through your your steps it looks like you mostly have it covered. To ensure the lease amount of problems try to install on the same drive and directory on the production server as you have on your test server.

There is also a number of settings that you will want to make sure are compatible with you new server ect After you have copied over you geoserver installation to your new server and before you start it check the following:

In the [webserver root]/webapps/geoserver/WEB-INF directory check you web.xml file. Make sure the following setting is set as required on your production server

<context-param>
       <param-name>GEOSERVER_DATA_DIR</param-name>
        <param-value>C:\Developing_backup\SIMONS_REPOS\EBS_COG\COG\geoserver_data</param-value>
    </context-param>

In your geoexplorer source code make sure the that the proxy setting still points to the correct location;

var app = new gxp.Viewer({
    proxy: "<PROXY_URL>",

Finally in [webserver root]/conf directory check your server.xml, context.xml and web.xml for any hard coded paths ect that may need to be changed for the new server name.

If you are confident that you have no paths/ url's that include the server name then you probably don't need to check any of those items.

  • thx for your answer! – artwork21 Oct 24 '13 at 12:11
1

We run two Geoserver instances sharing one database. One instance for Development, Testing, then one instance for Production.

Each Geoserver Instance is on a seperate machine, as is the database.

We backup our database regularly, and load the data into the tables. Once loaded, the tables almost never have to be touched, hence why we share the database between the two GeoServer Instances.

We make sure that the installed versions on both Geoserver instances are exactly the same, the directory naming is exactly the same, especially on the drives. (moving from C: to D: on different machines WILL cause you grief)

When we migrate, we simply shut down both Geoservers and copy the data_dir between the two, after making backups so they can be quickly restored in the event something goes wrong, then restart the Geoserver instances.

An alternative approach would be to use the GeoServer Work spaces if you are limited on the number of machines you have. They would run on the one GeoServer Instance, but are a little more work to maintain.

Basically you have work space A and work space B, one is production and one is testing/development. When you have your test site running and want to deploy it to production, simply change the work space reference on your WMS calls. You would then have to modify the new test work space with the changes made previously once the new production is running and stable. You could extend concept this by having three work spaces, one a master so you don't lose the changes and do not have to keep as much documentation. As i said, this is a little more work and effort.

You can even have two versions of the databases, one in each work space if you want to keep the data separated, but switching between databases between each different work space has caused us quite a few issues. We have only been able to get it to work by actually deleting and creating all the layers again.

To switch between work spaces is very easy, just change you WMS call to A:layername or B:layername, where A and B represent your work space names.

You could also consider GeoWebCache for you production front end and two work spaces on geoserver, or two geoserver machines, then to change between production and test means just changing the GeoWebCache config, nothing to do on the client side. GeoWebCache will deliver significant performance benefits on tile serving as well. We have just set this up and are very happy with it.

Of course, I am assuming that you want your test site versions accessible to others for testing, if it is just you, you could run it all on you PC then migrate it.

Hope this helps.

  • thx for your answer! – artwork21 Oct 24 '13 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.