Restore backup from command line

Calmetrics is helping us (guided-wave.com) develop a user interface for our hardware using Ignition. I am writing an installer for this software which our customers will use to install Ignition on their system and restore a gateway backup containing the application. My problem is that I don’t want our customer to have to interact with the gateway home page to restore the backup. Is there a way to use gwcmd from within my installer to restore the backup? Or, is there another way I should be installing Ignition and establishing the gateway without having to restore from a backup?

Hi,

There are really only two components that make an Ignition gateway unique: the modules, installed in “user-lib/modules”, and the internal database, which is in “data/db”.

It sounds to me like the best option would be perhaps to use one of the zip packages and your own script or program, instead one of the actual installers. The zip distributions contain all of the standard modules, so if you’re not using anything special, the sequence would just go like this:

  1. Unzip package to desired install directory
  2. Replace the default “data/db” folder with your own, containing the internal database for the customer.
  3. Run install-ignition.bat to register the windows service
  4. Run start-ignition.bat to start the service.

If you had special modules, just put them in the module directory before starting the service.

Hope this helps,

That sounds promising; I will give a try. Thanks!

I’ve been working on other things and am now looking at this again. I have a couple of other questions about a non-interactive install:

  1. Is there a way to install the Ignition license without using the gateway interface?

  2. Is there a way to tie licenses to a particular machine to “encourage” customers to not install multiple instances using the same license?

[quote=“steven.elam”]I’ve been working on other things and am now looking at this again. I have a couple of other questions about a non-interactive install:

  1. Is there a way to install the Ignition license without using the gateway interface?

  2. Is there a way to tie licenses to a particular machine to “encourage” customers to not install multiple instances using the same license?[/quote]

  3. Yes, from the GCU command line.

  4. This is already how it works.

Could you expand on “from the gcu command line”? Is there some documentation on this? gwcmd --help doesn’t show anything about licensing, and launch-gcu simply opens the Gatey Control Utility.

inductiveautomation.com/support/ … ghtsub=gcu

Looks like the -w switch is the closest thing - but it doesn’t work how I thought. You must already have obtained a license.ipl file from the offline activation process… which requires accessing the web interface to get the activation_request.txt file :scratch:

I’ll ask around…

EDIT: Ok, there’s also the -a switch, which activates a cd-key and gives you the activation_request.txt, which you can upload to out offline activation site, get an ipl in return, then install using -w.

I was working with v7.5.6 which didn’t have the -a and -w switches. I have now downloaded v7.5.10 which does. This looks like what I need.

Now I would like to test this, but I’m going to need a CD-key. Who should I talk to about getting one for development purposes? Jim Meisler?

Thanks for the help!

Yeah, your sales rep can help you out with getting a key.

Thanks to Jim M. I now have a CD-key.

Next problem: After installing ignition, creating and starting the service as recommended above, when I go to localhost:8088 in my browser, I get error 404 “The requested resource () is not available”.

The gcu shows that the web server has started but the gateway status never completes (i.e. shows an hourglass).

Are there any errors in logs/wrapper.log? If so, please post them here.

Yes, there are errors:

WARN | wrapper | 2013/08/22 11:16:40 | Unable to write to the configured log directory: logs (The system cannot find the path specified. (0x3))
WARN | wrapper | 2013/08/22 11:16:40 | The directory does not exist.
WARN | wrapper | 2013/08/22 11:16:40 | Unable to write to the configured log file: logs\wrapper.log (The system cannot find the path specified. (0x3))
WARN | wrapper | 2013/08/22 11:16:40 | Falling back to the default file in the current working directory: wrapper.log
STATUS | wrapper | 2013/08/22 11:16:40 | Ignition Gateway service installed.
WARN | wrapper | 2013/08/22 11:16:40 | Unable to write to the configured log directory: logs (The system cannot find the path specified. (0x3))
WARN | wrapper | 2013/08/22 11:16:40 | The directory does not exist.
WARN | wrapper | 2013/08/22 11:16:40 | Unable to write to the configured log file: logs\wrapper.log (The system cannot find the path specified. (0x3))
WARN | wrapper | 2013/08/22 11:16:40 | Falling back to the default file in the current working directory: wrapper.log
STATUS | wrapper | 2013/08/22 11:16:40 | Starting the Ignition Gateway service…
WARN | wrapper | 2013/08/22 11:16:40 | Unable to write to the configured log directory: logs (The system cannot find the path specified. (0x3))
WARN | wrapper | 2013/08/22 11:16:40 | The directory does not exist.
WARN | wrapper | 2013/08/22 11:16:40 | Unable to write to the configured log file: logs\wrapper.log (The system cannot find the path specified. (0x3))
WARN | wrapper | 2013/08/22 11:16:40 | Falling back to the default file in the current working directory: wrapper.log
STATUS | wrapper | 2013/08/22 11:16:40 | --> Wrapper Started as Service
STATUS | wrapper | 2013/08/22 11:16:40 | Java Service Wrapper Standard Edition 64-bit 3.5.15
STATUS | wrapper | 2013/08/22 11:16:40 | Copyright © 1999-2012 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2013/08/22 11:16:40 | wrapper.tanukisoftware.com
STATUS | wrapper | 2013/08/22 11:16:40 | Licensed to Inductive Automation for Ignition Gateway
STATUS | wrapper | 2013/08/22 11:16:41 |
STATUS | wrapper | 2013/08/22 11:16:41 | Launching a JVM…
INFO | jvm 1 | 2013/08/22 11:16:41 | WrapperManager: Initializing…
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.startup.Embedded start
INFO | jvm 1 | 2013/08/22 11:16:43 | INFO: Starting tomcat server
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.core.StandardEngine start
INFO | jvm 1 | 2013/08/22 11:16:43 | INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.startup.DigesterFactory register
INFO | jvm 1 | 2013/08/22 11:16:43 | WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0.xsd
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.startup.DigesterFactory register
INFO | jvm 1 | 2013/08/22 11:16:43 | WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_1.xsd
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.startup.DigesterFactory register
INFO | jvm 1 | 2013/08/22 11:16:43 | WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.startup.DigesterFactory register
INFO | jvm 1 | 2013/08/22 11:16:43 | WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.startup.DigesterFactory register
INFO | jvm 1 | 2013/08/22 11:16:43 | WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd
INFO | jvm 1 | 2013/08/22 11:16:43 | Aug 22, 2013 11:16:43 AM org.apache.catalina.startup.DigesterFactory register
INFO | jvm 1 | 2013/08/22 11:16:43 | WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd
INFO | jvm 1 | 2013/08/22 11:16:45 | Aug 22, 2013 11:16:45 AM org.apache.catalina.core.StandardContext filterStart
INFO | jvm 1 | 2013/08/22 11:16:45 | SEVERE: Exception starting filter WicketFilter
INFO | jvm 1 | 2013/08/22 11:16:45 | javax.servlet.ServletException: Unable to start up context. Context temp folder “temp” does not exist.
INFO | jvm 1 | 2013/08/22 11:16:45 | at com.inductiveautomation.ignition.gateway.bootstrap.SRFilter.init(SRFilter.java:52)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
INFO | jvm 1 | 2013/08/22 11:16:45 | at com.inductiveautomation.catapult.CatapultBase.startTomcat(CatapultBase.java:206)
INFO | jvm 1 | 2013/08/22 11:16:45 | at com.inductiveautomation.catapult.Catapult.main(Catapult.java:80)
INFO | jvm 1 | 2013/08/22 11:16:45 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2013/08/22 11:16:45 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2013/08/22 11:16:45 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2013/08/22 11:16:45 | at java.lang.reflect.Method.invoke(Unknown Source)
INFO | jvm 1 | 2013/08/22 11:16:45 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:290)
INFO | jvm 1 | 2013/08/22 11:16:45 | at java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2013/08/22 11:16:45 | Aug 22, 2013 11:16:45 AM org.apache.catalina.core.StandardContext start
INFO | jvm 1 | 2013/08/22 11:16:45 | SEVERE: Error filterStart
INFO | jvm 1 | 2013/08/22 11:16:45 | Aug 22, 2013 11:16:45 AM org.apache.catalina.core.StandardContext start
INFO | jvm 1 | 2013/08/22 11:16:45 | SEVERE: Context [/main] startup failed due to previous errors
INFO | jvm 1 | 2013/08/22 11:16:45 | Aug 22, 2013 11:16:45 AM org.apache.coyote.http11.Http11Protocol init
INFO | jvm 1 | 2013/08/22 11:16:45 | INFO: Initializing Coyote HTTP/1.1 on http-8088
INFO | jvm 1 | 2013/08/22 11:16:45 | Aug 22, 2013 11:16:45 AM org.apache.coyote.http11.Http11Protocol start
INFO | jvm 1 | 2013/08/22 11:16:45 | INFO: Starting Coyote HTTP/1.1 on http-8088
STATUS | wrapper | 2013/08/22 11:16:45 | Ignition Gateway started.
INFO | jvm 1 | 2013/08/22 11:16:47 | Aug 22, 2013 11:16:47 AM org.apache.coyote.http11.Http11Protocol init
INFO | jvm 1 | 2013/08/22 11:16:47 | INFO: Initializing Coyote HTTP/1.1 on http-8043
INFO | jvm 1 | 2013/08/22 11:16:47 | Aug 22, 2013 11:16:47 AM org.apache.coyote.http11.Http11Protocol start
INFO | jvm 1 | 2013/08/22 11:16:47 | INFO: Starting Coyote HTTP/1.1 on http-8043
INFO | jvm 1 | 2013/08/22 12:20:41 | Received GetMainContextDetailsRequest…
INFO | jvm 1 | 2013/08/22 12:20:41 | …returning GetMainContextDetailsResponse (0ms)
INFO | jvm 1 | 2013/08/22 12:20:43 | Uncaught exception during getContextState():java.lang.NullPointerException

I see two things:

  1. The wrapper wants to write to logs/wrapper.log but the logs directory does not exist (an annoyance)

  2. A “temp” directory does not exist causing the WicketFilter to fail.

Remember, I’m installing a zipped build of ignition, i.e. not using the installer. Do these directories need to be added to the zip?

For some reason, your zip does not have a logs folder or a temp folder. If you create them both within your unzipped folder, everything should fire up. Do you still have the downloaded zip? If so, can you confirm that it does not have these folders? I looked at a Windows 32-bit 7.5.10 zip and the folders appear to be there within the zip.

The empty directories logs and temp exist in the zip file, but my third-party installation software was failing to unzip them. :scratch: I have fixed this by re-creating these directories after the zip file has been processed and before starting ignition.