Migration failed MySQL to PostgreSQL

Migrating from TurnKey Linux GitLab built from source. Originally it came as a Proxmox container with GitLab 8 something. It had a few bugs that may have been caused by the TKL install. Last December I took the time to upgrade it following the GitLab directions. It was upgraded to 11.4-stable and has been working great ever since.

Recently I set up a Kubernetes cluster and wanted to point my GitLab CI/CD at it. It was stuck on the Helm install issue. So I decided to migrate to GitLab-Omnibus running in a full Ubuntu 18.4 LTS.

Currently the upgrade is stuck on the migration with the following error.

ERROR Database error 2BP01: cannot drop constraint application_setting_terms_pkey on table application_setting_terms because other objects depend on it
I tried to delete the foreign key.

I tried to delete it from MySQL

mysql -u${MY_USER} -p${MY_PASS} ${MY_DATA} -e "ALTER TABLE application_setting_terms DROP FOREIGN KEY application_setting_terms_pkey;"

ERROR 1091 (42000): Can't DROP 'application_setting_terms_pkey'; check that column/key exists
MariaDB [gitlab_production]> SHOW CREATE TABLE application_setting_terms;
CREATE TABLE `application_setting_terms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cached_markdown_version` int(11) DEFAULT NULL,
  `terms` text COLLATE utf8_unicode_ci NOT NULL,
  `terms_html` text COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

I looked in MySQL and the table in the old DB does not have any foreign keys, constraints. This is my question. What is the workaround for this?

Right now I have two systems, my old GitLab-ce 11.4-stable built from source, pre and post partial migration, and the new Omnibus 11.4.0-ce. The new system is waiting for the backup of the old system after I can get it migrated to PostgreSQL.

This TKL image is based on Debian 9. MySQL engine is run by MariaDB 10.1.37

Edited Jul 14, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading