-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MigrateFromOTRS: migrate database using the commands mysqldump and mysql #644
Comments
@StefanRother-OTOBO For testing I have called something like that:
More testing is required. I only did a sanity check, whether the SQL script can be executed. Documentation is missing too. |
It's not obvious whether the problem with foreign key checks are avoided with this approach. Testing is needed. |
If I understand https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_foreign_key_checks correctly, then disabling foreign key check does not prevent the 'error 150' from existing foreign keys. A workaround might be to drop all relevant tables beforehand. For that i added yet another SQL script. Not that in case of errors, |
IMHO |
…_sign Issue RotherOSS/otobo#644: no equal sign needed in call of backup.pl
@StefanRother-OTOBO The '=' is not needed. I have adapted the installation docs accordingly. I propose to merge the current state of affairs into the rel-10_0 branch and proceed in the issues #648 and #649. |
…ml file for the elasticsearch insert.
…obo into issue-#644-mysqldump_take_3
@bschmalhofer - is my assumption correct, that the skipped tables from your check list in principle are already handled with ecbc969 (or maybe even earlier; currently line 428 and 429 of backup.pl), and the point is just not checked, because of possible foreign keys stuff? I would ignore this then, for now. Those tables, from what I see, are standing pretty much on their own or only hold temporary data in the first place (logs, process ids,...). I think we can tackle this, if we start to encounter problems, and up until now I'm aware of none, concerning this. |
@svenoe Exactly. The tables that should not be migrated are already taken into account by |
Stefan will incorporate some instructions into the manual. Reading the db name out of the config would just result in instructions easier to copy paste, as I understand it. Nice to have, but this can be incorporated somewhen else, too. |
In #534 an migration strategy was implemented that relied on moving table between database schemas using "ALTER TABLiE ... RENAME TO ...". This seemed to work in the considered case. However the considered cased is the well behaved cased where there are just about no differences between the source and the target schema. In real migrations there are problems when some of the attributes types have diverged. This divergence causes that some foreign key relationships can't be recreated during the migration process.
See also #575.
An example:
In a regular OTRS 6 or OTOBO 10 Installation:
At the customers site:
Leads to the error:
errno: 150 "Foreign key constraint is incorrectly formed"
Probably depending on the order in which the tables are migrated these error can occur when renaming the table or when re-adding foreign key constraints.
The suspicion is that these kind of errors might also occur with other migration strategies.
This problem was discussed by @StefanRother-OTOBO and @bschmalhofer . The conclusion was to abolish the 'RENAME TO' solution and to provide support for a database migration strategy based on mysqldump, sed, and mysql.
TODO:
The text was updated successfully, but these errors were encountered: