Migrating from multiple containers to single one with big version jump

Hi everyone :slight_smile:

I am currently running Gitlab 11.11.0 together with a Postgresql 11 database .
Both are running using a docker-compose script. Due to some negligence, the compose file was deleted and the gitlab instance was not updated in the past 3 years, which I want to fix now.
I have tried several ways of upgrading to a newer image, but because Gitlab 11.11.0 ships with psql up to version 10.7, I am having trouble.
I made a backup by installing a never version of psql and pg_dump and using those binaries to run gitlab-rake gitlab:backup:create which succeeded. When trying to restore the backup with a fresh image using the integrated postgresql binaries, I get errors. When I try to clone the containers and their volumes, it also runs into errors.
Is there a solution to backup my data, restore it into a single container of gitlab (11.11.0) and then upgrade it step by step to the latest image? Or can I somehow restore the backup of an old version into a newer one?

1 Like

It was a tedious process, but I managed it somehow.

First of all, I updated the internal postgresql in the container of gitlab, so the psql and pg_dump versions match that, of the postgresql container. I created a backup using gitlab-rake gitlab:backup:create of Gitlab 11.11.0 and Postgresql 11.3. Then I made the same setup using a docker-compose with a gitlab and postgresql container and restored it. I then followed the update path as shown here (something like 10.8.711.11.812.0.1212.1.1712.10.1413.0.1413.1.1113.8.813.12.1214.0.1114.1.614.3.2). When at version 14.0.11 or a later 14.0.x version, execute the command here so the update can be done without any trouble. When I arrived at the major release 13, I made another backup, since then the internal version of Gitlab was matching my container version. Afterwards I made another docker compose script with only using gitlab and its internal postgresql and restored the backup. Now I have a single container which also handles updates of the postgresql database.

Seems like everything is working for now and no one in my team has spotted any problems or errors in their workflow. Hope this helps someone :slight_smile:

1 Like