Skip to content

Commit

Permalink
add mysql-postgresql-converter submodule, and updated document
Browse files Browse the repository at this point in the history
  • Loading branch information
arif-ali committed Feb 28, 2014
1 parent 88e0a71 commit 051555f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .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
29 changes: 28 additions & 1 deletion 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
Expand All @@ -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
Expand All @@ -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
```
Expand All @@ -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
Expand All @@ -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
```

0 comments on commit 051555f

Please sign in to comment.