Entire LabKey Migration

LabKey Support Forum (Inactive)
Entire LabKey Migration lewis j mcgibbney  2015-10-05 21:48
Status: Closed
 
Hi Folks,
I thought I had enough information whilst in attendance at the conference last week (by the way what a great time we had in Seattle... really enjoyed it) to tackle the above issue however it seems like I am lacking some information.
I am looking to dump an entire instance of labkey (not just pointers to data, but the protocols, studies, registered modules, etc.) and migrate it to a new installation of LabKey.
Having spoken with Adam last week I was aware that it is possible to one of the following

1) Utilize the export features present within the GUI. It would allow protocol, studies, assays, etc. to be exported however this has the limitation that any custom data structures (which may for example have been produced by a custom third party module) will not be exported.
2) Use SQL dump’s which is a replication of the entire Postgres database itself. This would include custom data structures which may be been implemented by custom modules which may have been added.

On the 'custom modules' issue. I DO NOT want to loose registered modules when migrating so I need to have each module migrated as well. It was my understanding that I could do the following:

Registered modules are described and stored within $LABKEY_HOME/server/distributions/*.xml. Each of these files contain a target called “gather_modules” which registers and builds each module within the current distribution. A module descriptor therefor looks like the following

 14 <target name="gather_modules">
 15 <ant antfile="${basedir}/distributions/legacy.xml" target="gather_modules" />
 16 <copy todir="${dist.modules.dir}">
 17 <filelist dir="${staging.modules.dir}">
 18 <file name="cbcassay.module" />
 19 <file name="reagent.module" />
 20 <file name="viability.module" />
 21 <file name="letvin.module" />
 22 </filelist>
 23 </copy>
 24 </target>

The only issue is that, with LabKey Server vLabKey15.2-39071.18-bin I have no $LABKEY_HOME/server/distributions/*.xml.
Can someone advise as to what the best strategy is going forward with this migration?
Thank you very much in advance.
Lewis
 
 
adam responded:  2015-10-06 09:20
Folder export/import will round trip many objects from a folder or a tree of folders, but its not sufficient to replicate an entire LabKey Server. You need to use database backup/restore to round trip all data in the labkey database, so that every module's data is copied to your new system. Also, if you have important data in the file system (assay results, file uploads, etc.) you'll need to replicate that to the new system as well.

By "vLabKey15.2-39071.18-bin" I assume you're referring to a LabKey Server distribution file (typically it would end in .zip or .tar.gz). This is a single, binary distribution that includes a specific set of modules and no source at all. A couple options, once you've replicated the database and the files to the new system:

  • If the vLabKey15.2-39071.18-bin distribution includes all the modules you care about, simply deploy it on the new system.
  • If you need additional modules, you could deploy vLabKey15.2-39071.18-bin and then add the extra modules to externalModules.
  • Build an official distribution from source. As we discussed, you can create and build custom distributions from source. Sync up to the release15.2 branch, copy one of the existing xml files in $LABKEY_HOME/server/distributions to "lewis.xml", edit the file to add/remove modules and specify the desired format, and then run "ant dist -Dname=lewis". You now have a standard distribution you can use on every server, ensuring a consistent set of deployed modules. (As a convenience, the /distributions directory can appear inside a custom module directory as well.)
Adam
 
lewis j mcgibbney responded:  2015-10-06 13:35
Hi Adam, Thanks for reply.

> By "vLabKey15.2-39071.18-bin" I assume you're referring to a LabKey Server distribution file (typically it would end in .zip or .tar.gz). This is a single, binary distribution that includes a specific set of modules and no source at all.

Correct

Thanks for the explicit heads up on the remainder of the information. We are working on this today so I'll check back in here later with an update. Thanks again Adam. Most helpful.