dbTalk Databases Forums  

mysqldump - non-destructive restore?

comp.databases.mysql comp.databases.mysql


Discuss mysqldump - non-destructive restore? in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Magnus Warker
 
Posts: n/a

Default mysqldump - non-destructive restore? - 12-27-2010 , 12:40 AM






Hi,

I would like to do the following:

1) make a backup of my database using mysqldump
2) recreate the database by running the application's setup procedure
3) restore the backup data

In 2) the tables are created and some basic data is inserted.

In 3) the following restrictions should apply:

- no table should be dropped and recreated (-t)
- no data inserted by the setup procedure should be overwritten
- all date in the backup should be restored
- data from backup, the primary keys of which are already present, should be
ignored

I use the -t switch to prevent mysqldump from creating DROP/CREATE TABLE
statements.

But how can I prevent mysqldump to generate code that overwrites data?

I guess it has something to do with the LOCK statements, but I don't
understand them...

Thanks
Magnus

Reply With Quote
  #2  
Old   
Luuk
 
Posts: n/a

Default Re: mysqldump - non-destructive restore? - 12-27-2010 , 02:47 AM






On 27-12-10 07:40, Magnus Warker wrote:
Quote:
Hi,

I would like to do the following:

1) make a backup of my database using mysqldump
2) recreate the database by running the application's setup procedure
3) restore the backup data

In 2) the tables are created and some basic data is inserted.

In 3) the following restrictions should apply:

- no table should be dropped and recreated (-t)
- no data inserted by the setup procedure should be overwritten
- all date in the backup should be restored
- data from backup, the primary keys of which are already present, should be
ignored

I use the -t switch to prevent mysqldump from creating DROP/CREATE TABLE
statements.

But how can I prevent mysqldump to generate code that overwrites data?

I guess it has something to do with the LOCK statements, but I don't
understand them...

Thanks
Magnus
I think quickest way is to make another backup after step 2.

Then restore the complete backup, and after that restore the backup you
created after step 2.



--
Luuk

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.