Bug #22629 migrating from mysql to mysql deletes data on source db
Submitted: 23 Sep 2006 12:39 Modified: 15 Nov 2006 18:12
Reporter: Stefan Kaes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Migration Toolkit Severity:S1 (Critical)
Version:1.1.5rc OS:Windows (windows xp)
Assigned to: CPU Architecture:Any
Tags: data_loss

[23 Sep 2006 12:39] Stefan Kaes
Description:
After installing the latest mysql community version on windows today, I decided to migrate my data from my server (mysql 4.x) to my devleopment machine using the migration tool.

Everything seemed to go well, but after closing the migration tool and opening mysql administrator I didn't see the migrated tables. well, OK, I thought: the tool doesn't seem to work.

But then I discovered that the migration tool has DELETED ALL MIGRATED DATA on the source database.

Why on earth did the tool delete data on the source DB?

Can I do anything to get at the old data? 

How to repeat:
use the tool with mysql source and sink. but backup the source's data before you try.
[25 Sep 2006 8:06] Sveta Smirnova
Thank you for the report.

Could you please indicate accurate version of the MySQL Migration Toolkit you use?
[25 Sep 2006 11:20] Stefan Kaes
I downloaded the latest version of mysql on saturday.

I'm currently at a client's site and can't get the number from the install.

It should be

Windows (x86)		5.0.24a	40.0M
MD5: a2c08d51b08b24d30a26341d12c278f5
[25 Sep 2006 11:33] Sveta Smirnova
Please indicate accurate version of the Migration
Toolkit you use, not MySQL.
[29 Sep 2006 15:55] Stefan Kaes
The miration toolkit version is 1.1.3rc
[3 Oct 2006 6:33] Sveta Smirnova
Thank you for the feedback.

But I can not repeat the problem using default sequence of actions.

Please, indicate:

1. Do you migrate from localhost to remote host, from localhost to localhost or from remote host to localhost?
2. Accurate versions of both MySQL servers you use.
3. Accurate sequence of actions you did: which screens do you see, which buttons do you click etc.
[3 Oct 2006 20:44] Stefan Kaes
Sorry to say this, but a migration tool should never delete anything at the data source it's migrating from. This is absolutely foolish and can only happen if the design of the tool has a serious flaw.

I don't have the time to repeat this, so I can't tell you which buttons I clicked etc. The source DB was a remote 4.1.x, the sink db local 5.0.x.
[4 Oct 2006 6:27] Sveta Smirnova
MySQL Migration Toolkit does not erase any data on the source system.

If you will have time to tell us step-by-step how you loss your data, please, reopen the bug report. With current information I can not repeat it.
[1 Nov 2006 9:48] Roman Held
here's my theory:

- The current Migration Tool does not check, whether source and target are the same
- Stefan selected the source server twice
- The Tool creates the "DROP and CREATE"-Script and executes it on the target (in this case: on the same "source"-server and deletes all datas.

roman
(reproduced with Migration Tool 1.0.25)
[1 Nov 2006 20:25] Sveta Smirnova
Thank you for the hint, Roman.

Verified as described using current 5.0-r5 MySQL GUI Tools
[15 Nov 2006 18:12] Michael G. Zinner
I have added a detection for that and issue a warning dialog that this is not a valid configuration and will lead to data loss.
[4 Jun 2007 10:53] Li Xuan
This bug is quite critical..the source and target config ui should be some great different...otherwise it confused user very much...
[9 Apr 2008 10:18] Julio Granados
I have recently tried to use the Mysql miration toolkit v 1.1.12 with the same source and target on porpuse. The only thing I wanted was to create the scripts as a backup. Then I did get the warning message and cancelled the operation (the message appeared just before creating the migration scripts or transfer the data online), but it seems that the migration toolkit erased ALL of my data in the tables(I haven't repeated that). The tables remained, but I think (I haven't repeated that) the migration toolkit erased my foreign keys also. I was lucky to have a back-up :) before making the other back-up