recently I was forced to migrate from VPS hosting I had. I was away from home when I was asked to perform backups before the end of lease, so I had no time to backup all of the data in a way that backup should’ve been performed and that left me with all of my VPS data packed into a single .tar.gz.
Almost everything went smooth, the last thing that gives me nightmares is restoring my previous Gitlab-CE data.
This time I went with the dockerized version of Gitlab-CE. (gitlab/gitlab-ce:12.4.0-ce.0)
To be sure that I am not using wrong version during this process, I extracted which version I had installed from one of license files found in the backup.
I have confirmed that this image works without my data being mounted to volumes, but whenever I’ve tried to mount volumes recovered from backup:
/home/gitlab/logs:/var/log/gitlab
/home/gitlab/data:/var/opt/gitlab
/home/gitlab/config:/etc/gitlab
I was stuck with a fatal error regarding postgres db:
[execute] psql: FATAL: database locale is incompatible with operating systemDETAIL: The database was initialized with LC_COLLATE "en_US.UTF-8", which is not recognized by setlocale().
HINT: Recreate the database with another locale or install the missing locale.
I have tried setting ENV variables LANG, LANGUAGE, LC_ALL to different values without any luck.
I was not able to find solution on the internet so far, I wish I could’ve made a backup properly.
My wish is to restore old repositories (and if possible user accounts) from old installation I have stored.
Anything that could lead me into possible solution is very much appreciated!
This is my first question on stack so please forgive me if it is formed improperly, or is being asked in a wrong section.
2
Answers
Solution marked as an accepted answer worked beautifully, for further readers and to summarize, what was the final solution:
I have created an image using Dockerfile based on specific version of official gitlab-ce docker image and included locales packages.
Dockerfile in question:
Then it was just simple
If it is bloated, or something is not necessary feel free to correct me, otherwise it is what worked for me in the end.
Thanks once again to @Vonc for providing me with what lead to the final solution!
As in this thread, try and check if locales/tzdata are missing:
This is similar to
postgres-ai/custom-images
issues/4, which means, if it works at runtime, you might have to build your own GitLab image, with: