From 051555f32a0ad45698fe18dc09e79b32bb20f40b Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Fri, 28 Feb 2014 21:11:52 +0000 Subject: [PATCH] add mysql-postgresql-converter submodule, and updated document --- .gitmodules | 3 ++ database/migrate-mysql-to-postgres/README.md | 29 ++++++++++++++++++- .../mysql-postgresql-converter | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 160000 database/migrate-mysql-to-postgres/mysql-postgresql-converter diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4a98044 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "database/migrate-mysql-to-postgres/mysql-postgresql-converter"] + path = database/migrate-mysql-to-postgres/mysql-postgresql-converter + url = https://github.com/lanyrd/mysql-postgresql-converter.git diff --git a/database/migrate-mysql-to-postgres/README.md b/database/migrate-mysql-to-postgres/README.md index 132b95d..fa32993 100644 --- a/database/migrate-mysql-to-postgres/README.md +++ b/database/migrate-mysql-to-postgres/README.md @@ -1,3 +1,5 @@ +***The following howto assumes that you are running Debian 7 (wheezy)*** + # Stop Gitlab ```bash @@ -12,6 +14,8 @@ sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev # Initial Setup +The following initial setup was taken from installation.md from the main installtion doc + ```bash # Login to PostgreSQL sudo -u postgres psql -d template1 @@ -38,6 +42,8 @@ sudo -u git -H bundle install --deployment --without development test mysql aws # Dump the mysql database +Make sure you do this as root, and therefore you will also need the root password for mysql as well + ```bash mysqldump --compatible=postgresql --default-character-set=utf8 -r /tmp/gitlabhq_production.mysql -u root -p gitlabhq_production ``` @@ -46,9 +52,11 @@ mysqldump --compatible=postgresql --default-character-set=utf8 -r /tmp/gitlabhq_ ```bash wget https://raw.github.com/lanyrd/mysql-postgresql-converter/master/db_converter.py -O /tmp/db_converter.py -python db_converter.py /tmp/gitlab_production.mysql /tmp/gitlab_production.psql +python /tmp/db_converter.py /tmp/gitlab_production.mysql /tmp/gitlab_production.psql ``` +***Note:*** This was tested using debian 7, with python 2.7.3 + # Import the database ```bash @@ -63,9 +71,28 @@ sudo -u git -H cp database.yml database.yml.backup sudo -u git -H cp database.yml.postgresql database.yml ``` +The defaults from the database.yml should work if you have not made any modifications to the postgres authentication. You may need to change database.yml to suite your config. + # Start Gitlab service ```bash service gitlab start service nginx restart ``` + +# Check application Status + +Check if GitLab and its environment are configured correctly: + +```bash +cd ~git/gitlab +sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production +``` + +To make sure you didn't miss anything run a more thorough check with: + +```bash +cd ~git/gitlab +sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production +``` + diff --git a/database/migrate-mysql-to-postgres/mysql-postgresql-converter b/database/migrate-mysql-to-postgres/mysql-postgresql-converter new file mode 160000 index 0000000..3aef484 --- /dev/null +++ b/database/migrate-mysql-to-postgres/mysql-postgresql-converter @@ -0,0 +1 @@ +Subproject commit 3aef484c05485d3653680b7aae7cd65dc4cd01b7