SonarSource / mysql-migrator

Command line tool to migrate MySQL database of SonarQube 6.7-7.8 to non-MySQL
39 stars 11 forks source link

Should migrator update serverid ? #34

Closed mildis closed 5 years ago

mildis commented 5 years ago

After migrating successfully from mysql to postgres, there are no projects and issues visible on the new postgres instance. A warning in the logs states that the serverId has changed due to jdbc url change.

Due to operational requirement, I rollbacked to the original MySQL version.

Will a new analysis bring back older results ? Should a serverid update be done will migrating datas ?

Thanks

[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table organizations ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table organization_members ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table groups_users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules_parameters ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules_profiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table org_qprofiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table default_qprofiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_qprofiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table qprofile_edit_users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table qprofile_edit_groups ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table groups ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table snapshots ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table group_roles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rule_repositories ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table deprecated_rule_keys ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules_metadata ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table events ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table event_component_changes ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table quality_gates ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table quality_gate_conditions ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table org_quality_gates ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table properties ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_links ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table duplications_index ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table live_measures ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_measures ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table internal_properties ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table projects ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table manual_measures ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table active_rules ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table notifications ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table user_roles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table active_rule_parameters ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table metrics ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table issues ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table issue_changes ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table permission_templates ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table perm_tpl_characteristics ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table perm_templates_users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table perm_templates_groups ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table qprofile_changes ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table file_sources ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_queue ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_activity ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_task_characteristics ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_task_input ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_scanner_context ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_task_message ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table user_tokens ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table es_queue ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table plugins ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_branches ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table analysis_properties ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table webhooks ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table webhook_deliveries ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table alm_app_installs ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_alm_bindings ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_mappings ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table organization_alm_bindings ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table user_properties ...
Tables                     Records  Seconds  
-------------------------  -------  -------  
organizations                    1      0.1  
organization_members           111      0.0  
groups_users                   211      0.0  
rules_parameters              1054      0.1  
rules_profiles                  49      0.1  
org_qprofiles                   49      0.1  
default_qprofiles               22      0.0  
project_qprofiles               53      0.0  
qprofile_edit_users              0      0.0  
qprofile_edit_groups             0      0.0  
groups                          10      0.0  
snapshots                      512      0.1  
group_roles                    181      0.0  
rule_repositories               52      0.0  
deprecated_rule_keys             0      0.0  
rules                         8837      0.8  
rules_metadata                3957      0.2  
events                         356      0.1  
event_component_changes          0      0.1  
quality_gates                    7      0.0  
quality_gate_conditions         42      0.0  
org_quality_gates                7      0.0  
properties                     154      0.0  
project_links                   23      0.0  
duplications_index               0      0.0  
live_measures              4611679    374.4  
project_measures             29358      1.3  
internal_properties              3      0.0  
projects                    160205     23.4  
manual_measures                  0      0.0  
active_rules                  6276      0.2  
notifications                    0      0.0  
user_roles                      56      0.0  
active_rule_parameters         398      0.0  
users                          112      0.1  
metrics                        199      0.0  
issues                       43114      3.4  
issue_changes                41645      1.4  
permission_templates             2      0.0  
perm_tpl_characteristics         2      0.0  
perm_templates_users             3      0.0  
perm_templates_groups            6      0.0  
qprofile_changes              6766      0.2  
file_sources                 90789     41.9  
ce_queue                         1      0.1  
ce_activity                    386      0.1  
ce_task_characteristics          0      0.0  
ce_task_input                    1     10.2  
ce_scanner_context              99      4.3  
ce_task_message                 36      0.0  
user_tokens                     27      0.0  
es_queue                         0      0.0  
plugins                         30      0.1  
project_branches                36      0.0  
analysis_properties             75      0.0  
webhooks                         0      0.0  
webhook_deliveries               0      0.1  
alm_app_installs                 0      0.1  
project_alm_bindings             0      0.1  
project_mappings                 0      0.0  
organization_alm_bindings        0      0.0  
user_properties                  0      0.0  

Migration successful in 464.8 seconds
mildis commented 5 years ago

Never mind : a full reindex (stop and delete data/es5) resolved the issue.

ghost commented 5 years ago

Thanks for the update. And it seems you missed step 3 in the README.

mildis commented 5 years ago

Well, I did it but it seems step 3 is also step 5 :)