Database issue after upgrade/migratiion
Created by: UnicronBE
Situation: Migrating and upgrading a GitLab installation. Original installation is 6.9.2, installed from source. New installation is the latest Omnibus edtition installed from your repo's (7.14.3). The old installation used MySQL backend, so conversion to PostgreSQL also had to take place.
Steps taken: Backup of the original setup. On a testing server, setup a new 6.9.2 installation, imported the backup and upgraded to 7.14.3 via source. All is working at this point, but PostgreSQL migration has not yet been performed. Take backup from 7.14.3 test installation. Restored backup on the 7.14.3 installation on the destination server. Converted MySQL database to PostgreSQL (https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/mysql_to_postgresql.md) and restored. Restore shows no errors, all repo's are created as expected.
Issue: After restoring the backup as described above and running the rake check command, I receive the following error:
All migrations up? ... no
Try fixing it:
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
Please fix the error above and rerun the checks.
However, when I run "gitlab-rake db:migrate" I receive (link to full log underneath):
== 20140125162722 AddAvatarToProjects: migrating ==============================
-- add_column(:projects, :avatar, :string)
-> 0.1571s
== 20140125162722 AddAvatarToProjects: migrated (0.1576s) =====================
== 20140611135229 AddPositionToMergeRequest: migrating ========================
-- add_column(:merge_requests, :position, :integer, {:default=>0})
-> 0.0896s
== 20140611135229 AddPositionToMergeRequest: migrated (0.0900s) ===============
== 20140625115202 CreateUsersStarProjects: migrating ==========================
-- create_table(:users_star_projects)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Any help or advice very much appreciated!
Regards,
Timothy