Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Preparing the Grouper db

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Preparing the Grouper db

Chronological Thread 
  • From: <>
  • To: Earl Lewis <>, <> <>
  • Subject: Re: [grouper-users] Preparing the Grouper db
  • Date: Sat, 30 Mar 2013 14:58:00 -0700
  • Authentication-results:; dkim=neutral (message not signed) header.i=none

Gsh can take any java command, or there are "helper" commands that we have prebuilt.   All the helper commands and some API commands are on the Gsh doc page, I can add this one...


----- Reply message -----
From: "Earl Lewis" <>
To: "Chris Hyzer" <>, "<>" <>
Subject: [grouper-users] Preparing the Grouper db
Date: Fri, Mar 29, 2013 8:49 am


Hadn't heard from you so figured you were out on vacation.  I tried out the gsh command you suggested for me (you can see your suggested syntax further down in the thread) and after I fixed my own typos things worked great! Thanks so much for the help with that! It saved me a lot of typing and now I know how to move our data around from one instance to another. 

Obviously StemSave is a valid command for gsh, so that answers one of my questions.  My other question has to do with documentation for all of the gsh commands. Is there someplace other than the gsh wiki page that I can find documentation, e.g. javadoc for the gsh?

801-581-3635 (office)
801-554-3596 (mobile)

On 3/25/13 3:15 PM, "Earl Lewis" <> wrote:


Any thoughts/comments on my question from last week? 

I've actually learned a bit more about gsh and after starting gsh I ran: help("StemSave") and got a 
gsh 2% help("StemSave")    
cant find help on command: StemSave

However, running help for StemCopy gives this:
gsh 3% help("StemCopy")    
StemCopy help:
There is an object: StemCopy which has various chaining methods, 
which should be ended with a save() method.

So I guess this leads to the question of whether StemSave is a valid command/method or not?

801-581-3635 (office)
801-554-3596 (mobile)

On 3/21/13 3:17 PM, "Earl Lewis" <> wrote:


I've been able to generate a gsh script from the grouper_stems table as  you suggested. I think I'm in pretty good shape but I wanted to verify via documentation that I had the correct syntax/options for my script. However, when I look through the gsh documentation I don't see the StemSave method documented. I do see addStem and see that it only supports three parameters; the parent stem name, the extension and the display extension. 

This differs a little bit from what you suggested that I include in the StemSave in that you included the name, friendly extension and description. As you're probably well aware there are the following columns in the grouper_stems table:
Id, parent_stem, name, display_name, extension, display_extension, description, last_membership_change, alternate_name along with some other audit related columns. 

My question is, are there additional methods in StemSave to include those other columns if we so desired? So could I add something like .assignAlternateName() to the gsh command syntax?

801-581-3635 (office)
801-554-3596 (mobile)

On 3/15/13 11:22 AM, "Chris Hyzer" <> wrote:

The best way is probably to export from hsql and import to oracle with GSH:


This will do all the data, stems and everything else.


If you just want some stems, you could query grouper_stems from hsql, and generate a GSH script that looks like this:


grouperSession = GrouperSession.startRootSession();

new StemSave(grouperSession).assignName("a:b:c").assignSaveMode(SaveMode.INSERT_OR_UPDATE).assignDisplayExtension(“Friendly extension�).assignDescription(“Some description�).assignCreateParentStemsIfNotExist(true).save();

new StemSave(grouperSession).assignName("a:b:d").assignSaveMode(SaveMode.INSERT_OR_UPDATE).assignDisplayExtension(“Friendly extension2�).assignDescription(“Some description2�).assignCreateParentStemsIfNotExist(true).save();









From: [] On Behalf Of Earl Lewis
Sent: Thursday, March 14, 2013 4:23 PM
Subject: [grouper-users] Preparing the Grouper db


We've spent some time messing around with Grouper and the hsql database that installs by default. We've built out a test folder hierarchy in that hsql db and are wondering about moving it to another database backend. We've successfully setup the hibernate connection to talk to an Oracle backend and also been able to get the DDL script to run successfully to create the Oracle schema.


In fact, we were actually able to use the hsql db .script file to load data into the Oracle database and this seemed to work, at least initially. We had to disable/re-enable all the primary/foreign key constraints in order for it to load up but that actually seemed to work fine. Once the database was running for a while hibernate started throwing some errors and everything eventually came crashing down. We were seeing an error in the catalina.out logs that looked like this: "java.sql.BatchUpdateException: ORA-00001: unique constraint (GROUPER.MEMBERSHIP_UNIQ_IDX) violated".


The database kept running but the Grouper UI stopped running and would not restart  once these errors started.  Obviously there were some troubles with the data that we loaded in and don't necessarily want to try to resolve this particular problem. It seems pretty clear from the error that we were generating conflicting data (groups, members, memberships, etc.) somehow.


What I would like to do is salvage the folder structure from our hsql db by trying to load just the "stems" data into the Grouper database. I can truncate all the tables and try it but what I guess I'm wondering is what kind of seed data does Grouper need to be able to allow this kind of "jump start"? If it's not possible so be it, we'll just start with a fresh database and go from there. 


One thing I noticed is that in the instructions for "preparing for production" there are clear instructions for getting the Oracle database setup. I followed these and they all worked great. The thing that I didn't see is if there is any sort of seed data required to start with a fresh database (besides setting up the subject source)?



Earl Lewis

801-581-3635 (office)

801-554-3596 (mobile)

Archive powered by MHonArc 2.6.16.

Top of Page