{"id":755,"date":"2017-11-10T15:13:10","date_gmt":"2017-11-10T14:13:10","guid":{"rendered":"https:\/\/www.yelloworb.com\/orbblog\/?p=755"},"modified":"2017-11-10T15:13:54","modified_gmt":"2017-11-10T14:13:54","slug":"upgrading-postgres-version","status":"publish","type":"post","link":"https:\/\/www.yelloworb.com\/orbblog\/upgrading-postgres-version\/","title":{"rendered":"Upgrading postgres version"},"content":{"rendered":"<p>Suppose you made a brew upgrade and postgres got upgraded. Follow then these steps to upgrade your old DB data to the new version.<\/p>\n<p>Start to move of your old data directory:<br \/>\n<code class=\"\" data-line=\"\">mv  \/usr\/local\/var\/postgres \/usr\/local\/var\/postgres_96_20171110<\/code><\/p>\n<p>Initialize a new fresh DB with the new version of postgres<br \/>\n<code class=\"\" data-line=\"\">initdb \/usr\/local\/var\/postgres\/<\/code><\/p>\n<p>Check which postgres services are running and stop all<br \/>\n<code class=\"\" data-line=\"\">brew services list<\/code><\/p>\n<p>Stop all postgres services, one command for each:<br \/>\n<code class=\"\" data-line=\"\">brew services start postgresql<\/code><\/p>\n<p>Run postgres upgrade tool(-b and -B are the bin directories for old and new version, and -d and -D same for data directories):<br \/>\n<code class=\"\" data-line=\"\">pg_upgrade -b \/usr\/local\/Cellar\/postgresql\\@9.6\/9.6.6\/bin\/  -B \/usr\/local\/Cellar\/postgresql\/10.1\/bin\/ -d \/usr\/local\/var\/postgres_20171110 -D \/usr\/local\/var\/postgres<\/code><\/p>\n<p>Start the postgres service again:<br \/>\n<code class=\"\" data-line=\"\">brew services start postgresql<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Suppose you made a brew upgrade and postgres got upgraded. Follow then these steps to upgrade your old DB data to the new version. Start to move of your old data directory: mv \/usr\/local\/var\/postgres \/usr\/local\/var\/postgres_96_20171110 Initialize a new fresh DB with the new version of postgres initdb \/usr\/local\/var\/postgres\/ Check which postgres services are running and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[68,74,23,28],"tags":[],"class_list":["post-755","post","type-post","status-publish","format-standard","hentry","category-rails","category-server","category-software","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/comments?post=755"}],"version-history":[{"count":1,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/755\/revisions"}],"predecessor-version":[{"id":756,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/755\/revisions\/756"}],"wp:attachment":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/media?parent=755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/categories?post=755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/tags?post=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}