Closed pumox closed 5 years ago
Hi, well the setup wiizzard do not migrate from MariaDB to Postgresql at any time. You can do it on your own or you can use the appended helper script to do the mysql to postgres migration... and maybe, just maybe read the instructions before...
Kind Regards
Ok excuse me @jboxberger , I didn't read that before because I was using the upgrade wizard from Synology and didn't expect to have to check back here. However I will do in future. So, in my case where the wizard made the upgrade I just have to SSH into the Disc Station and run the following command?
sudo ./var/packages/synology-gitlab-jboxberger/scripts/migrate-m10 --maria-db-root-password "mdb10-root-password" --maria-db-database "mdb10-gitlab-databse-name"
Sorry I'm not an Synology/Linux expert, so any advice would be very helpfull.
Where can I find this script? After SSH into the Disc Station I only see the folder "/var/packages/Docker-GitLab" but no "/var/packages/Docker-GitLab-jboxberger" and the script is also not there under "/var/packages/Docker-GitLab/scripts".
Kind Regards
hi pumox,
which version do you had installed prevously? 9.4.4-0050 with MariaDB 10, right? Had anything worked fine? If the Upgrade will not Work for you you can always go back to 9.4.4-0050 as lon as you have not deleted the /volume1/gitlab folder and you MariaDB Database.
Have you already installed the "9.4.4-0100 PostgreSQL GitLab Package"
https://github.com/jboxberger/synology-gitlab-jboxberger/releases?after=10.5.5-0100
Hi @jboxberger , it was the official Synology Gitlab 9.4.4 and as I know I had all previous gitlab updates installed that were available through the Synology Package Manager. But I'm not 100% sure if it was 9.4.4-0050 or 9.4.4-0100. Yes, Gitlab was using MariaDB 10 and worked fine.
Here is also the info from one of the backups (backup_information.yml):
:db_version: '20170725145659' :backup_created_at: 2018-07-15 03:04:47.273709160 +00:00 :gitlab_version: 9.4.4 :tar_version: tar (GNU tar) 1.27.1 :skipped: ''
The 9.4.4-0050 is the stock package, there were no 9.4.4-0100 release from Synology Inc. I have released the 9.4.4-0100 with the postgres db linked for the migration path. You can download the 9.4.4-0100 here. You just need to follow the migration steps. After installing 9.4.4-0100 you will find the synology-gitlab-jboxberger folder and the containing migration script.
Please follow this Steps: https://github.com/jboxberger/synology-gitlab-jboxberger#migrate-from-stock-944-0050-synology-gitlab-package
Thank you jboxberger, however actually I have the 10.6.4-0051 installed. Shoud I uninstall this Version? I guess the gitlab folder could already be affected by the newer Version. Is it possible to do a downgrade in this case?
PS: It must have been so, that I upgraded from stock package 9.4.4-0050 to stock package 10.6.4-0051 without the intermediate step 9.4.4-0100.
DO NOT DELETE 1) /volume1/docker/gitlab 2) MariaDB Databases
In any case make a Backup before! Save your "/volume1/docker/gitlab" dir and MariaDB Database.
You can uninstall 10.6.4-0051 without problems but keep the data during uninstall! The Data on the FIlesystem usually in "/volume1/docker/gitlab" should be not affected. After Uninstall you should also delete the postgres docker container and postgres data usually in "/volume1/docker/gitlab-db/"
After that you should reach the state as you just had uninstalled 9.4.4-0050. Now you can follow the steps 3 + 4 + 5.
I reccomend you to upgrde to GitLab 10.5.5-0100 before you update to the 11.0.1-0101. I am not shure wether the Gitlab internal databases migration scripts can migrate the database scheme from 9.4.4 to 11.0.1.
Kind Regards
###########################################################################################
########################################################################################### Continue migration anyway? (y/n): y Warning: World-writable config file '/var/packages/MariaDB10/etc/my.cnf' is ignored Warning: World-writable config file '/var/packages/MariaDB10/etc/my.cnf' is ignored create /volume1/docker/mysqld/mysqld-migration.sock link pulling dimitri/pgloader:latest image latest: Pulling from dimitri/pgloader e833e65f6ad9: Pull complete cdcfbf9f2bf6: Pull complete df59ed72c3d6: Pull complete Digest: sha256:6a07ecf625235b551ae6f8340584a2bbbee8947946c5172ed4035cb22ae611ae Status: Downloaded newer image for dimitri/pgloader:latest creating dimitri-pgloader container [Line 259] Exec WebAPI: api=SYNO.Docker.Container, version=1, method=create, param={"is_run_instantly":true,"profile":{"cap_add":null,"cap_drop":null,"cmd":"bash","cpu_priority":50,"devices":null,"enable_publish_all_ports":false,"enable_restart_policy":false,"enabled":false,"env_variables":[{"key":"PATH","value":"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}],"exporting":false,"id":"fb6ab9e5e8b8714c7089ebb724a80d3097014f99d229f14ac78ab7b1cf8b6f52","image":"dimitri/pgloader:latest","is_ddsm":false,"is_package":false,"links":[{"alias":"postgresql","link_container":"synology_gitlab_db"}],"memory_limit":0,"name":"dimitri-pgloader","network":[{"driver":"bridge","name":"bridge"}],"network_mode":"bridge","port_bindings":[],"privileged":false,"shortcut":{"enable_shortcut":false},"ulimits":null,"use_host_network":false,"volume_bindings":[{"host_volume_file":"/docker/mysqld/mysqld-migration.sock","mount_point":"/var/run/mysqld/mysqld.sock","type":"rw"}],"volumes_from":null}}, runner= { "data" : { "dependent_container" : [ "synology_gitlab_db" ], "start_dependent_container" : true }, "httpd_restart" : false, "success" : true } CREATE gitlab_migration Superuser NOTICE: role "gitlab_migration" does not exist, skipping ALTER ROLE KABOOM! FATAL error: At
INTO postgres://gitlab_migration:99TdYCpt5AkP@postgresql:5432/gitlab
WITH include no drop, tr ^ (Line 4, Column 0, Position 181)
In context KW-INTO:
While parsing KW-INTO. Expected:
the character Tab
or the character Newline or the character Return or the character Space or the string "--" or the string "/*" or the string "into" An unhandled error condition has been signalled: At
INTO postgres://gitlab_migration:99TdYCpt5AkP@postgresql:5432/gitlab
WITH include no drop, tr ^ (Line 4, Column 0, Position 181)
In context KW-INTO:
While parsing KW-INTO. Expected:
the character Tab
or the character Newline or the character Return or the character Space or the string "--" or the string "/*" or the string "into"
What I am doing here?
At
INTO postgres://gitlab_migration:99TdYCpt5AkP@postgresql:5432/gitlab
WITH include no drop, tr ^ (Line 4, Column 0, Position 181)
In context KW-INTO:
While parsing KW-INTO. Expected:
the character Tab
or the character Newline or the character Return or the character Space or the string "--" or the string "/*" or the string "into"
Its very briefly starts Docker image dimitri-pgloader and then says: "dimitri-pgloader stopped unexpectedly" in DSM.
Any thought?
Hi,
what is the old Gitlab Version you had prevously? What is the current installed Version?
Kind Regads
Hi @jboxberger , Like I said, it's exactly like your tutorial 1:1.
As in > Migrate from stock 9.4.4-0050 Synology GitLab Package After running the migrate script, I get the above output. After that Gitlab is running but no projects of users.
So at the moment your GitLab 9.4.4-0100 PostgreSQL version is running. I still have the MariaDB data and the entire gitlab data in a separate backup.
It looks like the dimitri/pgloader container which is required for the conversion from mysql to psql is broken. As you say the container is not able to start.
Mybe you can post the log of the pgloader container.
Kind Regards
Could you tell me how to do that? In DSM I can see the docker container appear but as soon as the scripts stops, the container disappears.
Its actually as soon as the container appears it stops again and it gives me an alert popup with the message "container undefined does not exist".
Yes, of course. I think the script deltes automatically the container after it runs on error and it is too fast so you can not really do something over the UI.
Just modify the Line 174 in the migrate-m10 script and comment the line.
https://github.com/jboxberger/synology-gitlab-jboxberger/blob/ade0663a447c895a2f9f10ee5d04bc91325acdc1/src/scripts/migrate-m10#L174
modify to #docker rmi "$PGLOADER_IMAGE"
This prevent the container from deltetion and you should be able to view the logs.
Thanks! I did what you said. The container does still not persist. In the short time that is exists it says 'no logs available'.
I just feel we are going to solve this problem :)
OK, I also commented out this line "$SYNO_WEBAPI --exec api=SYNO.Docker.Container version=1 method=delete name="$PGLOADER_CONTAINER" force=true preserve_profile=false" Now the container does stay up and running after the script has completed to run.
When I go to the logs tab, there are no logs available. When I go to the terminal tab, I get a console logged in with root. Thats it...
ok i will check this today when i am home from work. i should be able to reproduce this,
Ok there seems to be a problem which i can not reproduce.
I reccomend you to unistall the synology-gitlab-jboxberger package completely and reinstall the prevous package. You can find the older original synology packages here.
After that you can update to the original 11.0.4-0053 package and then you have at least a working Gitlab on psql.
I will revive the https://github.com/jboxberger/synology-gitlab package which is technically the stock package but with the updated GitLab Version. Later you will be able to install it over the stock synology package without any doubts or extras.
Kind Regards
Well, that is exacly what I tried to do in the first place but I could never update to the latest Synology version because of the error during the migration from mariadb to postgresql. Are you saying that if I update from stock gitlab to your v11 that it will work? Do I still have to run the update script via the terminal?
No if you even cant migrate from stock mariadb to stock postgres then this will not help you. it seems like your db somehow corrupted. have you tried the import / export feature from GitLab?
Hello kdesigns,
If you still use the synology-gitlab-jboxberger package please migrate to my synology-gitlab or to the stock package, since this package will not be updated any more.
Kind Regards
Hi, during the upgrade from 9.4.4 to 10.6.4-0051 via Synology Package Manager, the setup wizard also migrated the database from MariaDB to Postgresql. At least, I thought it will. Unfortunately after it completed I saw a brand new instance of Gitlab Community without my projects, users, runners etc. What can I do now, to get my data back into Postgresql? I still can see the data in MariaDB.