Import the database as the `git` user

This ensures that all tables created during the import belong to `git`.
If you import as a different user, such as the `postgres` superuser, you
may encounter issues where the GitLab database user cannot access tables
in gitlabhq_production, _even if_ `git` is the owner of
gitlabhq_production at the time of import.
This commit is contained in:
Jacob Vosmaer 2014-05-19 18:28:45 +02:00
parent f08cb26487
commit 8ee3299cc4
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ git clone https://github.com/lanyrd/mysql-postgresql-converter.git
cd mysql-postgresql-converter
mysqldump --compatible=postgresql --default-character-set=utf8 -r databasename.mysql -u root gitlabhq_production
python db_converter.py databasename.mysql databasename.psql
psql -f databasename.psql -d gitlabhq_production
# Import the database dump as the application database user
sudo -u git psql -f databasename.psql -d gitlabhq_production
sudo service gitlab start
```