Re: Copying encypted DB?

2015-04-17 Thread John English

On 15/04/2015 21:10, mike matrigali wrote:

this is better.  i did not realize derby supported changing the encryption key.
https://db.apache.org/derby/docs/10.10/devguide/tdevcsecurenewkeyoverview.html
On 4/15/2015 10:57 AM, Peter Ondruška wrote:

Unless I missed something why not just create backup and then open the backup
copy and change encryption key.


Many thanks. I also didn't realise it was so simple (phew!). I suppose the moral 
of the story is RTFM...

--
John English



Copying encypted DB?

2015-04-15 Thread John English
I have a DB which is encrypted with one password, and I want to generate an 
identical copy of it which will be encrypted using a different password (so that 
I can provide copies of the same DB for two different customers without exposing 
one customer's password to the other).


I thought at first I could create the tables from a script and then run lots of 
insert into foo (select * from bar) queries, but this won't work unless the 
auto-generated columns are allocated with the same sequence numbers so that the 
foreign key references will match up. And in some case the keys are not 
sequential, due to deletions.


Is there an easy way to do this?

TIA,
--
John English


Re: Copying encypted DB?

2015-04-15 Thread mike matrigali

this is better.  i did not realize derby supported changing the encryption key.
https://db.apache.org/derby/docs/10.10/devguide/tdevcsecurenewkeyoverview.html
On 4/15/2015 10:57 AM, Peter Ondruška wrote:

Unless I missed something why not just create backup and then open the backup 
copy and change encryption key.

On Wednesday, 15 April 2015, John English john.fore...@gmail.com 
mailto:john.fore...@gmail.com wrote:

I have a DB which is encrypted with one password, and I want to generate an 
identical copy of it which will be encrypted using
a different password (so that I can provide copies of the same DB for two 
different customers without exposing one customer's
password to the other).

I thought at first I could create the tables from a script and then run lots of 
insert into foo (select * from bar) queries,
but this won't work unless the auto-generated columns are allocated with 
the same sequence numbers so that the foreign key
references will match up. And in some case the keys are not sequential, due 
to deletions.

Is there an easy way to do this?

TIA,
-- 
John English




--
Peter Ondruška




--
email:Mike Matrigali - mikema...@gmail.com
linkedin: https://www.linkedin.com/in/MikeMatrigali



Re: Copying encypted DB?

2015-04-15 Thread mike matrigali

I suggest trying the following:
shutdown db completely, do not do anything below while system is running.

o do a full backup of the database to another location.  you can use derby 
tools for this
   or copy it yourself if you know what you are doing.
o unencrypt the 2nd database:
http://db.apache.org/derby/docs/10.10/devguide/cdevcsecuredecryptdb.html
o reencrypt the 2nd database:
http://db.apache.org/derby/docs/10.10/devguide/tdevcsecureunencrypteddb.html

On 4/15/2015 9:58 AM, John English wrote:
I have a DB which is encrypted with one password, and I want to generate an identical copy of it which will be encrypted using a 
different password (so that I can provide copies of the same DB for two different customers without exposing one customer's 
password to the other).


I thought at first I could create the tables from a script and then run lots of insert into foo (select * from bar) queries, but 
this won't work unless the auto-generated columns are allocated with the same sequence numbers so that the foreign key references 
will match up. And in some case the keys are not sequential, due to deletions.


Is there an easy way to do this?

TIA,



--
email:Mike Matrigali - mikema...@gmail.com
linkedin: https://www.linkedin.com/in/MikeMatrigali



Re: Copying encypted DB?

2015-04-15 Thread Peter Ondruška
Unless I missed something why not just create backup and then open the
backup copy and change encryption key.

On Wednesday, 15 April 2015, John English john.fore...@gmail.com wrote:

 I have a DB which is encrypted with one password, and I want to generate
 an identical copy of it which will be encrypted using a different password
 (so that I can provide copies of the same DB for two different customers
 without exposing one customer's password to the other).

 I thought at first I could create the tables from a script and then run
 lots of insert into foo (select * from bar) queries, but this won't work
 unless the auto-generated columns are allocated with the same sequence
 numbers so that the foreign key references will match up. And in some case
 the keys are not sequential, due to deletions.

 Is there an easy way to do this?

 TIA,
 --
 John English



-- 
Peter Ondruška