{"id":279613,"date":"2016-05-05T11:30:02","date_gmt":"2016-05-05T07:30:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=279613"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=279613","title":{"rendered":"Redmine: \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441 MySQL \u043d\u0430 PostgreSQL 9.5"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/52b\/290\/19d\/52b29019d1783d5f7b5c9c77e8b37877.png\" alt=\"image\"\/><br \/>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u044b <a href=\"https:\/\/centos-admin.ru\">\u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438<\/a> \u0432\u0441\u0435 \u0447\u0430\u0449\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0441\u044c\u0431\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441 MySQL \u043d\u0430 PostgreSQL. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 PostgreSQL \u0434\u0430\u0435\u0442 \u043f\u043e\u0432\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u043e \u0441\u043c\u0435\u043d\u0435 \u0421\u0423\u0411\u0414. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u00ab\u043e\u0431\u0440\u043e\u0441\u043b\u0430\u00bb \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0431\u0430\u0437\u0430 \u043f\u043e\u0434 MySQL.<\/p>\n<p>  \u041c\u044b \u0441\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 Redmine \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u043d\u0435\u0433\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0438 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u044d\u0442\u0443 CRM \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0411\u0414 MySQL \u043d\u0430 PostgreSQL 9.5 \u0434\u043b\u044f Redmine \u043d\u0430 \u041e\u0421 CentOS 6.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0451\u043c:<\/p>\n<p>  1. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 PostgreSQL 9.5<\/p>\n<pre><code class=\"bash\">rpm -ihv https:\/\/download.postgresql.org\/pub\/repos\/yum\/9.5\/redhat\/rhel-6-x86_64\/pgdg-centos95-9.5-2.noarch.rpm <\/code><\/pre>\n<p>  2. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0430\u043c PostgreSQL 9.5.<\/p>\n<pre><code class=\"bash\">yum install postgresql95-server postgresql95-contrib postgresql95-devel service postgresql-9.5 initdb ru_RU.utf8 chkconfig postgresql-9.5 on  alternatives --install \/usr\/bin\/psql psql \/usr\/pgsql-9.5\/bin\/psql 5000 alternatives --install \/usr\/bin\/pg_dump pg_dump \/usr\/pgsql-9.5\/bin\/pg_dump 5000 alternatives --install \/usr\/bin\/pg_config pg_config \/usr\/pgsql-9.5\/bin\/pg_config 5000 alternatives --install \/usr\/bin\/createdb createdb \/usr\/pgsql-9.5\/bin\/createdb 5000 alternatives --install \/usr\/bin\/createuser createuser \/usr\/pgsql-9.5\/bin\/createuser 5000 alternatives --install \/usr\/bin\/dropdb dropdb \/usr\/pgsql-9.5\/bin\/dropdb 5000 alternatives --install \/usr\/bin\/dropuser dropuser \/usr\/pgsql-9.5\/bin\/dropuser 5000 alternatives --install \/usr\/bin\/pg_dumpall pg_dumpall \/usr\/pgsql-9.5\/bin\/pg_dumpall 5000 alternatives --install \/usr\/bin\/createuser createuser \/usr\/pgsql-9.5\/bin\/createuser 5000 <\/code><\/pre>\n<p>  3. \u0414\u0435\u043b\u0430\u0435\u043c \u0442\u044e\u043d\u0438\u043d\u0433 PostgreSQL \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/pgtune.leopard.in.ua\/\">pgtune.leopard.in.ua<\/a>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>  4. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e PostgreSQL \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0433\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 localhost \u043f\u043e \u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043a\u0435\u0442, \u0430 root \u043c\u043e\u0433 \u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u00abpostgres\u00bb \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f.<\/p>\n<p>  pg_hba.conf:  <\/p>\n<pre><code class=\"bash\">local   all             postgres        ident                   map=supervisor host    all             all             127.0.0.1\/32            md5 <\/code><\/pre>\n<p>  pg_ident.conf:  <\/p>\n<pre><code class=\"bash\">supervisor      postgres                postgres supervisor      root                    postgres <\/code><\/pre>\n<p>  5. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0411\u0414 \u00abredmine\u00bb \u0432 PostgreSQL:  <\/p>\n<pre><code class=\"bash\">createuser --username=postgres --no-superuser --no-createdb --no-createrole --encrypted redmine createdb --username=postgres  --encoding=utf-8 --template=template0 --owner=redmine redmine psql --username=postgres --dbname=postgres --command=&quot;ALTER USER \\&quot;redmine\\&quot; WITH ENCRYPTED PASSWORD 'yourgreatpassword'&quot; <\/code><\/pre>\n<p>  6. \u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e MySQL \u0432 redmine\/config\/database.yml:  <\/p>\n<pre><code class=\"bash\"># \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0434\u0432\u0430 \u043f\u0440\u043e\u0431\u0435\u043b\u0430 (!) production:   adapter: postgresql   database: redmine   host: localhost   username: redmine   password: &quot;yourgreatpassword&quot; <\/code><\/pre>\n<p>  7. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 py-mysql2pgsql. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0442\u0438\u043f\u0430 yaml_db \u043d\u0435 \u0434\u0430\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u2014 Redmine \u0443\u043f\u043e\u0440\u043d\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c py-mysql2pgsql.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">yum install python-pip python-devel pip install py-mysql2pgsql <\/code><\/pre>\n<p>  \u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"bash\">py-mysql2pgsql <\/code><\/pre>\n<p>  \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c py-mysql2pgsql.yml, \u0432\u043d\u043e\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 MySQL \u0438 \u043d\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b PostgreSQL.<\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1 \u0413\u0431 \u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043d\u044f\u043b \u043f\u043e\u0440\u044f\u0434\u043a\u0430 15 \u043c\u0438\u043d\u0443\u0442.  <\/p>\n<pre><code class=\"bash\">py-mysql2pgsql -v -f mysql2pgsql.yml <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435!<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043b\u044e\u0431\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  P.S. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 Zabbix \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 200 \u0413\u0431 \u0441 MySQL \u043d\u0430 PostgreSQL. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442!               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/282938\/\"> https:\/\/habrahabr.ru\/post\/282938\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/52b\/290\/19d\/52b29019d1783d5f7b5c9c77e8b37877.png\" alt=\"image\"\/><br \/>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u044b <a href=\"https:\/\/centos-admin.ru\">\u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438<\/a> \u0432\u0441\u0435 \u0447\u0430\u0449\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0441\u044c\u0431\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441 MySQL \u043d\u0430 PostgreSQL. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 PostgreSQL \u0434\u0430\u0435\u0442 \u043f\u043e\u0432\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u043e \u0441\u043c\u0435\u043d\u0435 \u0421\u0423\u0411\u0414. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u00ab\u043e\u0431\u0440\u043e\u0441\u043b\u0430\u00bb \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0431\u0430\u0437\u0430 \u043f\u043e\u0434 MySQL.<\/p>\n<p>  \u041c\u044b \u0441\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 Redmine \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u043d\u0435\u0433\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0438 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u044d\u0442\u0443 CRM \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0411\u0414 MySQL \u043d\u0430 PostgreSQL 9.5 \u0434\u043b\u044f Redmine \u043d\u0430 \u041e\u0421 CentOS 6.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-279613","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=279613"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279613\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=279613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=279613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=279613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}