-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
easy migration from mysql to postrgesql? #429
Comments
Gitlab has some info on the subject here https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/mysql_to_postgresql.md |
did you manage to migrate to postgresql? |
Gave up after a while, seems like a headache to do this within the docker container.
Probably doable if I spent more time banging against it until it worked. Will probably just stick with mysql :/ |
okay.. i will give it a shot and let you know the instructions if i am successfull. |
Please try these instructions: Step 1: Start the posqtgresql container for our GitLab instance docker run -it --rm --name postgresql \
-v /srv/docker/gitlab/posqtgresql \
-e DB_USER=<POSTGRESQL_DB_USER> -e DB_PASS=<POSTGRESQL_DB_PASS> \
-e DB_NAME=<POSTGRESQL_DB_NAME> \
sameersbn/postgresql Substitute Step 2: Create another postgresql container for the migration Now we start a new postgresql container for the migration, linking it with the existing mysql container and the postgresql container created in the previous step. Assuming that the current mysql container is named docker run -it --rm --name postgresql-migrate \
--link mysql:mysql --link postgresql:postgresql \
sameersbn/postgresql bash You will be dropped into the containers shell. Step 3: Install the required packages: apt-get update && apt-get install -y ed git python mysql-client Step 4: Perform the migration Replace the parameters in git clone https://github.com/gitlabhq/mysql-postgresql-converter.git -b gitlab
cd mysql-postgresql-converter
mysqldump --compatible=postgresql --default-character-set=utf8 -r gitlabhq_production.mysql -h mysql -u <MYSQL_DB_USER> <MYSQL_DB_NAME> -p
python db_converter.py gitlabhq_production.mysql gitlabhq_production.psql
psql -h postgresql -U <POSTGRESQL_DB_USER> -f gitlabhq_production.psql -d <POSTGRESQL_DB_NAME> The above commands will dump the existing mysql database, and migrate it to the new postgresql container. Once done you can exit this container and you should have your gitlab database migrated to the postgresql instance. Now all you need to do is update the docker run command for the gitlab instance, linking it with the postgresql container and update the database connection parameters as required. reference: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/mysql_to_postgresql.md |
Please let me know if this resolves the issue. Thanks. |
did it work? |
closing issue. |
I'll make sure to give this a whirl when the time opens up. Thanks for your quick reply! |
Hi , We are trying to convert mysql to pgsql - the following error occurred - please help ASAP .
|
Hi, I'm having similar issue. Line 1401 (of 4740: 29.56%) [33 tables] [185 inserts] [ETA: 0 min 13 sec]Traceback (most recent call last): line 1401 of mysql dump is: 85siva , What is Line 23803 in your mysql dump? |
The official GitLab guide provides a easy guide to use pgloader to migrate the data from MySQL to PostgreSQL. |
Hi guys, I would just like to briefly describe here my migration test steps. Right now I'm through with the tests and everything seems to be fine. That's just a report to consider. I've been using this setup for quite some time and am super satisfied. Ok my steps. I have:
(you need to replace container names and your path to your migration.load file)
this is just an example and not a finished manual. No guarantee that it will work 100%. more information you can find here: https://gitlab.com/gitlab-org/gitlab-ee/issues/2799 I hope this information can help someone. |
I deal with "UnicodeDecodeError: 'utf8' codec can't decode byte 0xXY" error by using To Sum up: Then: To finish: |
Is there an easy way to migrate an existing setup from mysql to postgresql?
The text was updated successfully, but these errors were encountered: