users@glassfish.java.net

Re: How to back up and restore the GF derby databases

From: Paul MERLIN <paul_at_nosphere.org>
Date: Mon, 26 May 2008 11:59:51 +0200

Hi Jagadish,

Thanks for answering.

Le Monday 26 May 2008 10:28:14 Jagadish Prasath Ramu, vous avez écrit :
> Can you try setting the property "restoreFrom" via datasource property
> "connectionAttributes"
>
> eg:
> connectionAttributes=";create=true" // can be found in appserver's
> DerbyPool
> properties
>
> similarly try setting:
> connectionAttributes=";create=true;restoreFrom=path"
>
> [I havent tried it, and you may have to remove the property once the
> backup is complete.]
Ok, so if I want to automate this, I would have to fetch the current
connectionAttributes property of my connection pool, append the restoreFrom
directive, then "do something", then restore the old value of
connectionAttributes.

Now my question is what is this "do something" ? Is a simple
ping-connection-pool enough ? I don't think so, as there may be already
openned connections in the pool so new connectionAttributes won't be used.
Plus I would like to restore the database without starting glassfish so my
deployed apps are not available.

I feel all this a little dirty, there's no documented way of doing
backup/restore easily for the GF database ?

Maybe the best way to go would be to do all this without glassfish nor asadmin
and write scripts that start a derby process only for doing the restore. What
do you think ?

Regards

Paul