diff options
author | Igor <idrozdov@gitlab.com> | 2019-08-05 15:06:02 +0000 |
---|---|---|
committer | Igor <idrozdov@gitlab.com> | 2019-08-05 15:06:02 +0000 |
commit | 7efb062c3c3c7b44113d0dc0fe78fc9b8e95bd7c (patch) | |
tree | a12bde9bbeffcc0c365d3a29339d0389dcefdd8f /doc/update/mysql_to_postgresql.md | |
parent | 2bd1320f86b8cfd5d60199c5f7f0caa1cc2aa66b (diff) | |
parent | 3dfc89ade452ad7f0185653b30ed1d4bb2544fb0 (diff) | |
download | gitlab-ce-id-test-codeowners.tar.gz |
Merge branch 'master' into 'id-test-codeowners'id-test-codeowners
# Conflicts:
# .gitlab/CODEOWNERS
Diffstat (limited to 'doc/update/mysql_to_postgresql.md')
-rw-r--r-- | doc/update/mysql_to_postgresql.md | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/doc/update/mysql_to_postgresql.md b/doc/update/mysql_to_postgresql.md index 1e424134242..f6a1b6abdbf 100644 --- a/doc/update/mysql_to_postgresql.md +++ b/doc/update/mysql_to_postgresql.md @@ -72,15 +72,15 @@ need to enable the bundled PostgreSQL: 1. Stop GitLab: - ```bash - sudo gitlab-ctl stop - ``` + ```bash + sudo gitlab-ctl stop + ``` 1. Edit `/etc/gitlab/gitlab.rb` to enable bundled PostgreSQL: - ``` - postgresql['enable'] = true - ``` + ``` + postgresql['enable'] = true + ``` 1. Edit `/etc/gitlab/gitlab.rb` to use the bundled PostgreSQL. Please check all the settings beginning with `db_`, such as `gitlab_rails['db_adapter']` @@ -91,22 +91,22 @@ need to enable the bundled PostgreSQL: for the changes to take effect. 1. Start Unicorn and PostgreSQL so that we can prepare the schema: - ```bash - sudo gitlab-ctl start unicorn - sudo gitlab-ctl start postgresql - ``` + ```bash + sudo gitlab-ctl start unicorn + sudo gitlab-ctl start postgresql + ``` 1. Run the following commands to prepare the schema: - ```bash - sudo gitlab-rake db:create db:migrate - ``` + ```bash + sudo gitlab-rake db:create db:migrate + ``` 1. Stop Unicorn to prevent other database access from interfering with the loading of data: - ```bash - sudo gitlab-ctl stop unicorn - ``` + ```bash + sudo gitlab-ctl stop unicorn + ``` After these steps, you'll have a fresh PostgreSQL database with up-to-date schema. @@ -116,57 +116,57 @@ new PostgreSQL one: 1. Save the following snippet in a `commands.load` file, and edit with your MySQL database `username`, `password` and `host`: - ``` - LOAD DATABASE - FROM mysql://username:password@host/gitlabhq_production - INTO postgresql://gitlab-psql@unix://var/opt/gitlab/postgresql:/gitlabhq_production + ``` + LOAD DATABASE + FROM mysql://username:password@host/gitlabhq_production + INTO postgresql://gitlab-psql@unix://var/opt/gitlab/postgresql:/gitlabhq_production - WITH include no drop, truncate, disable triggers, create no tables, - create no indexes, preserve index names, no foreign keys, - data only + WITH include no drop, truncate, disable triggers, create no tables, + create no indexes, preserve index names, no foreign keys, + data only - ALTER SCHEMA 'gitlabhq_production' RENAME TO 'public' + ALTER SCHEMA 'gitlabhq_production' RENAME TO 'public' - ; - ``` + ; + ``` 1. Start the migration: - ```bash - sudo -u gitlab-psql pgloader commands.load - ``` + ```bash + sudo -u gitlab-psql pgloader commands.load + ``` 1. Once the migration finishes, you should see a summary table that looks like the following: - ``` - table name read imported errors total time - ----------------------------------------------- --------- --------- --------- -------------- - fetch meta data 119 119 0 0.388s - Truncate 119 119 0 1.134s - ----------------------------------------------- --------- --------- --------- -------------- - public.abuse_reports 0 0 0 0.490s - public.appearances 0 0 0 0.488s - . - . - . - public.web_hook_logs 0 0 0 1.080s - ----------------------------------------------- --------- --------- --------- -------------- - COPY Threads Completion 4 4 0 2.008s - Reset Sequences 113 113 0 0.304s - Install Comments 0 0 0 0.000s - ----------------------------------------------- --------- --------- --------- -------------- - Total import time 1894 1894 0 12.497s - ``` - - If there is no output for more than 30 minutes, it's possible `pgloader` encountered an error. See - the [troubleshooting guide](#troubleshooting) for more details. + ``` + table name read imported errors total time + ----------------------------------------------- --------- --------- --------- -------------- + fetch meta data 119 119 0 0.388s + Truncate 119 119 0 1.134s + ----------------------------------------------- --------- --------- --------- -------------- + public.abuse_reports 0 0 0 0.490s + public.appearances 0 0 0 0.488s + . + . + . + public.web_hook_logs 0 0 0 1.080s + ----------------------------------------------- --------- --------- --------- -------------- + COPY Threads Completion 4 4 0 2.008s + Reset Sequences 113 113 0 0.304s + Install Comments 0 0 0 0.000s + ----------------------------------------------- --------- --------- --------- -------------- + Total import time 1894 1894 0 12.497s + ``` + + If there is no output for more than 30 minutes, it's possible `pgloader` encountered an error. See + the [troubleshooting guide](#troubleshooting) for more details. 1. Start GitLab: - ```bash - sudo gitlab-ctl start - ``` + ```bash + sudo gitlab-ctl start + ``` You can now verify that everything works as expected by visiting GitLab. |