exporting a study michael_stover  2011-07-26 08:40
Status: Closed
 
I've been exporting some studies and moving them to a new server. I discovered that specimen requests do not seem to be exported. Is this true? Also, the Specimen Request Settings did not transfer. How do I copy the requests and the request settings to a new server?
 
 
eknelson responded:  2011-07-26 15:06
Hi Michael,

Export/import of specimen request settings is not supported today. I've opened a bug to track this work - it's certainly something we'd like to support:
https://www.labkey.org/issues/home/Developer/issues/details.view?issueId=12722

Export/import of specimen requests themselves is not supported either. In this case, we have no current plans to add support. Having two active servers with the same requests typically isn't desirable. If you're fully moving your LabKey Server to new hardware (as you appear to be doing), you might consider doing a database backup on the old server and a restore on the new one. This avoids doing things piecemeal.

Thanks,
Elizabeth
 
michael_stover responded:  2011-07-27 12:17
Elizabeth,
   Thanks for the suggestion. However, using pg_dump and psql to dump and restore the database to a different server does not appear to be a simple thing. One is a windows machine, one linux - I don't know if this is a confounding factor. The dump goes fine, but then restore runs into many errors. If the two database have different roles, then that causes problems, and I get hundreds of "invalid command" errors when doing the restore. After trying a few times, my test labkey no longer starts up successfully. I am not keen on using this method to get our production server up and running. Especially since we already have everything in place and copied with the one exception of the requests.
 
Brian Connolly responded:  2011-07-27 13:44
Michael,
In terms of the errors you are getting when attempting to restore a dump from the older server to the new server, I can give you some advice.

1) On the old server, when you run pgdump, make sure you specify the "--format=c" option

2) On the new server, you will need to add the roles that are in use on the old server. To add a new role to your new server, you can run the following from the command line

  createuser --superuser ROLENAME

do this for each role you need to create

3) On the new server, lets use a different database from the one your currently have configured, so you will need to create a new database by running the following from the command line
  
  createdb NEWDBNAME

4) On the new server perform the restore by running the command

  pg_restore -d NEWDBNAME --format=c DB_BACKUP_FILE


If you experience any errors during the restore such as "role does not exist' etc. Then stop the restore, drop the NEWDBNAME database (run command dropdb NEWDBNAME), create NEWDBNAME database again, fix the problem (ie if you are missing a role, create the new role ) and then try the restore command again.


When the restore has completed successfully, you can simply edit your labkey.xml configuration file to point to the new database and restart the LabKey Server.


I hope this helps.

-Brian
 
michael_stover responded:  2011-07-27 14:09
Brian,
     I followed those steps. When I restart labkey, I get:

java.lang.NullPointerException
       at java.io.File.<init>(File.java:222)
       at org.apache.log4j.RollingFileAppender.rollOver(RollingFileAppender.java:157)
       at org.labkey.api.module.ModuleLoader.rollErrorLogFile(ModuleLoader.java:332)
       at org.labkey.api.module.ModuleLoader.doInit(ModuleLoader.java:195)
       at org.labkey.api.module.ModuleLoader.init(ModuleLoader.java:171)
       at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
       at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
       at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
       at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3666)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4258)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
       at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:634)
       at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:561)
       at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:496)
       at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
       at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
       at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
       at org.apache.catalina.core.StandardService.start(StandardService.java:448)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
 
Brian Connolly responded:  2011-07-27 14:18
Michael,

Are you seeing this in your browser when you attempt to first connect? Can you please attach the catalina.out, labkey.log and labkey-errors.log file. This will make it easier to debug your problem.