Sonarqube LTS migration issues

Out company have a sonarqube 6.7.7 LTS and we plan to migrate to the latest LTS sonarqube 8.9.6
Reading migration guide I have to update from 6.7.7 LTS to 7.9.6 LTS and than to the latest LTS

I had a lot of issue in migration steps. We use postgresql 9.6, jdbc driver shipped with sonarqube itself.
No plugin has been migrated.
During migration we get following error in migration steps when upgrade to 7.9.6 LTS from 6.7.7 LTS

  • Execution of migration step #2020
    ERROR: cannot drop index project_branches_kee because constraint project_branches_kee on table project_branches requires it
    Hint: You can drop constraint project_branches_kee on table project_branches instead.
  • Execution of migration step #2119
    ERROR: cannot drop index user_tokens_login_name because constraint user_tokens_login_name on table user_tokens requires it
    Hint: You can drop constraint user_tokens_login_name on table user_tokens instead.
  • Execution of migration step #2606
    ERROR: cannot drop index file_sources_uuid_type because constraint file_sources_uuid_type on table file_sources requires it
    Hint: You can drop constraint file_sources_uuid_type on table file_sources instead.

I had remove constraints manually and on every error retry the migration by https:…/sonar/setup link

After migrate to 7.9.6 LTS migrate to 8.9.6 LTS

  • Execution of migration step #3307
    ERROR: cannot drop index uniq_group_roles because constraint uniq_group_roles on table group_roles requires it
    Hint: You can drop constraint uniq_group_roles on table group_roles instead.
  • Execution of migration step #3550
    Fail to execute ALTER TABLE metrics ADD CONSTRAINT pk_metrics PRIMARY KEY (uuid)
    ERROR: multiple primary keys for table “metrics” are not allowed
  • Execution of migration step #3570
    ERROR: cannot drop index uniq_perm_tpl_charac because constraint uniq_perm_tpl_charac on table perm_tpl_characteristics requires it
    Hint: You can drop constraint uniq_perm_tpl_charac on table perm_tpl_characteristics instead.
  • Execution of migration step #3585
    ERROR: cannot drop index uniq_profile_rule_ids because constraint uniq_profile_rule_ids on table active_rules requires it
    Hint: You can drop constraint uniq_profile_rule_ids on table active_rules instead.
  • Execution of migration step #3609
    ERROR: cannot drop index uniq_group_roles because constraint uniq_group_roles on table group_roles requires it
    Hint: You can drop constraint uniq_group_roles on table group_roles instead.
  • Execution of migration step #3609
    ERROR: cannot drop index groups_users_unique because constraint groups_users_unique on table groups_users requires it
    Hint: You can drop constraint groups_users_unique on table groups_users instead.
  • Execution of migration step #3618
    ERROR: cannot drop index qprofile_edit_groups_unique because constraint qprofile_edit_groups_unique on table qprofile_edit_groups requires it
    Hint: You can drop constraint qprofile_edit_groups_unique on table qprofile_edit_groups instead.
  • Execution of migration step #3635
    ERROR: multiple primary keys for table “quality_gates” are not allowed
  • Execution of migration step #3663
    ERROR: cannot drop index qprofile_edit_users_unique because constraint qprofile_edit_users_unique on table qprofile_edit_users requires it
    Hint: You can drop constraint qprofile_edit_users_unique on table qprofile_edit_users instead.

I hope this help you to fix migration steps for the future

2 Likes