Hi Myrna,

Thanks for your reply.

As I noted in my previous message that I already got the answer to my query through a web article.  However, thanks to you for you reply nevertheless.

-Dinesh

--- On Sat, 24/4/10, Myrna van Lunteren <m.v.lunteren@gmail.com> wrote:

From: Myrna van Lunteren <m.v.lunteren@gmail.com>
Subject: Re: Database restoration not working.
To: "Derby Discussion" <derby-user@db.apache.org>
Date: Saturday, 24 April, 2010, 9:01 PM

On Fri, Apr 23, 2010 at 7:37 PM, Dinesh Bajaj <dinesh.bajaj@ymail.com> wrote:
Hi All,

My understanding is that restoring a backedup database should restore it to to its original location. If for example, a database is backedup from the location c:\one to c:\two, and if it is later restored, then the database ought to be restored to the original location, i.e. c:\one. However, I find that this is not the case with Derby. 

String connectionURL = "jdbc:derby:mydbname;restoreFrom=c:/temp/two/mydbname"

On using the above-mentioned connection string, the connection to the database is indeed made; however, it is not restored to its original location. Where the database is restored, and how I can get it restored to its original location?

Thanks in advance.

Regards,
Dinesh



Hi Dinesh,
 
As you found, derby does not retain information about the directory structure around the database, just the internal organization of the database itself. And the backup/restore doesn't keep that information either.
Derby processes start from the location where the java process is invoked...
So, to restore to the original position, I'd suggest starting the restore in the original location.
Or, you can just specify the target directory in the URL, i.e.:
String connectionURL = "jdbc:derby:c:/temp/one/mydbname;restoreFrom=c:/temp/two/mydbname"
That should make mydbname database get restored to c:/temp/one.
 
Myrna