Add postgresql 9.0 upgrading instructions for Debian and Ubuntu. Debian instructions...
authorrsoulliere <robert.soulliere@mohawkcollege.ca>
Wed, 13 Apr 2011 19:26:16 +0000 (15:26 -0400)
committerrsoulliere <robert.soulliere@mohawkcollege.ca>
Wed, 13 Apr 2011 19:26:16 +0000 (15:26 -0400)
1.6/admin/migratingdata_1.6.xml
2.0/admin/Upgrading-Evergreen-2.0.xml
2.0/admin/migratingdata_2.0.xml

index 26b96bb..4558d06 100644 (file)
@@ -492,8 +492,8 @@ CREATE TABLE students (
                                possibilities.</para> \r
                                <para> <database class="field">ident_type</database> is the identification type used for identiying users. This is a integer value referencing \r
                                <database class="table">config.identification_type</database> and should \r
-                               match the id values of that table. The default values are <literal>1</literal> for Drivers License, <literal>2</literal>for SSN or \r
-                               <literal>3</literal>for other.</para>\r
+                               match the id values of that table. The default values are <literal>1</literal> for Drivers License, <literal>2</literal> for SSN or \r
+                               <literal>3</literal> for other.</para>\r
                                <para><database class="field">home_ou</database> is the home organizational unit for the user. This value needs to match the corresponding \r
                                <database class="field">id</database> in the <link linkend="actor.table.org-unit"><database class="table">actor.org_unit</database></link> \r
                                table.</para>           \r
index 84a5408..f99969d 100644 (file)
@@ -331,59 +331,137 @@ cd /openils/bin
                        on finding solutions and seeking further assistance from the Evergreen community.</para>  \r
                </note>\r
        </section>\r
-       <section xml:id="upgrading_Postgresqlto8.4">\r
-               <title>Upgrading PostgreSQL from 8.2 to 8.4 (if required)</title>\r
-               <para>Evergreen 2.0 requires PostgreSQL version 8.4 or later.</para>\r
-               <note><para>The order of the following steps is very important.</para></note><indexterm><primary>databases</primary><secondary>PostgreSQL</secondary></indexterm>\r
-               <procedure>\r
-                       <step>\r
-                               <para>As <systemitem class="username">opensrf</systemitem>, stop the evergreen and opensrf services:</para>\r
-                               <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>\r
-                       </step>                 \r
-                       <step>\r
-                               <para><link linkend="backingup">Backup the Evergreen database data</link></para>\r
-                       </step>\r
-                       <step>\r
-                               <para>Upgrade to Postgresql 8.4 by removing old version and installing Postgresql 8.4</para>\r
-                       </step>\r
-                       <step>                  \r
-                               <para>Create an empty Evergreen database in postgresql 8.4 by issuing the following commands as the postgres user:</para>\r
-<screen>\r
-<userinput>\r
-createdb -E UNICODE evergreen\r
+<section xml:id="upgrading_Postgresqlto9.0">\r
+               <title>Upgrading PostgreSQL from 8.4 to 9.0</title>\r
+               <simplesect>\r
+                       <title>Upgrading PostgreSQL on Debian Squeez</title>\r
+                       <procedure>\r
+                               <step>\r
+                                       <para>Stop Evergreen and disconnect clients from database.</para>\r
+                               </step>                 \r
+                               <step>\r
+                                       <para>Add the following line to <filename>/etc/apt/sources.list</filename>:</para> \r
+<programlisting>\r
+deb http://www.backports.org/debian squeeze-backports main contrib non-free\r
+</programlisting>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Update the sources list on your server.</para>\r
+<screen><userinput>                            \r
+apt-get update\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Backup your databases</para>\r
+<screen><userinput>                            \r
+$ pg_dump [db connect args] [db name] > evergreen-backup.sql\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Install PostgreSQL 9.0 as well as the client, contrib and plperl support packages.</para>\r
+<screen><userinput>                            \r
+apt-get -t squeeze-backports install postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0 postgresql-plperl-9.0\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Drop the empty 9.0 cluster.</para>\r
+<screen><userinput>                            \r
+pg_dropcluster --stop 9.0 main\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Update the 8.4 cluster (with evergreen database) to 9.0</para>\r
+<screen><userinput>                            \r
+pg_upgradecluster 8.4 main\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Test by logging into psql, checking the postgrSQL version and running a simple SELECT query.</para>\r
+<screen><userinput>    \r
+psql -U evergreen                      \r
+evergreen=# select version();\r
+evergreen=# select count(*) from biblio.record_entry;\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Restart Evergreen and Apache.</para>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Drop old 8.4 cluster (optional).</para>\r
+<screen><userinput>    \r
+pg_dropcluster 8.4 main\r
+</userinput></screen>\r
+                               </step>\r
+                       </procedure>\r
+               </simplesect>\r
+                       <simplesect>\r
+                       <title>Upgrading PostgreSQL on Ubuntu 10.04</title>\r
+                       <procedure>\r
+                               <step>\r
+                                       <para>Stop Evergreen and disconnect clients from database.</para>\r
+                               </step>                 \r
+                               <step>\r
+                                       <para>Add the backport repository to your repository sources list:</para> \r
+<programlisting>\r
+sudo add-apt-repository ppa:pitti/postgresql\r
+</programlisting>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Update the sources list on your server.</para>\r
+<screen><userinput>                            \r
+apt-get update\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>As the <systemitem class="username">postgres</systemitem> user, backup your PostgreSQL databases.</para>\r
+<screen><userinput><![CDATA[                           \r
+pg_dumpall > data\r
+]]></userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>As <systemitem class="username">root</systemitem>, remove PostgreSQL 8.4 and install 9.0.</para>\r
+<screen><userinput>                            \r
+aptitude purge postgresql-8.4\r
+aptitude install postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0 postgresql-plperl-9.0\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>as the <systemitem class="username">postgres</systemitem> user, recreate empty evergreen databases with required language supports.</para>\r
+<screen><userinput>\r
+dropdb evergreen\r
+createdb -T template0 --lc-ctype=C --lc-collate=C -E UNICODE evergreen\r
 createlang plperl   evergreen\r
 createlang plperlu  evergreen\r
 createlang plpgsql  evergreen\r
-psql -f /usr/share/postgresql/8.4/contrib/tablefunc.sql evergreen\r
-psql -f /usr/share/postgresql/8.4/contrib/tsearch2.sql evergreen\r
-psql -f /usr/share/postgresql/8.4/contrib/pgxml.sql evergreen\r
-</userinput>\r
-</screen>              \r
-                       </step>\r
-                       <step>\r
-                               <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL server, create a PostgreSQL user named <systemitem class="username">evergreen</systemitem> for the database cluster:</para>\r
-                               <screen><userinput>createuser -P -s evergreen</userinput></screen>\r
-                               <para>Enter the password for the new PostgreSQL superuser (<systemitem class="username">evergreen</systemitem>)</para>  \r
-                       </step>                 \r
-                       <step>\r
-                               <para>Restore data from backup created in step 1.</para>\r
-                       </step>\r
-                       <step>\r
-                               <para>To point tsearch2 to proper function names in 8.4, run the SQL script \r
-                               <filename>/home/opensrf/Evergreen-ILS*/Open-ILS/src/sql/Pg/000.english.pg84.fts-config.sql</filename> using the <command>psql</command> command.</para>\r
-                               <screen><userinput>cd /home/opensrf/Evergreen-ILS*</userinput></screen>\r
-                               <screen><userinput>psql -f /Open-ILS/src/sql/Pg/000.english.pg84.fts-config.sql evergreen</userinput></screen>\r
-                       </step>\r
-                       <step>\r
-                               <para><link linkend="startingopensrf">Restart Evergreen and OpenSRF services</link></para>\r
-                       </step>\r
-                       <step>\r
-                               <para>For additional information regarding upgrading PostgreSQL, see the following documentation in PostgreSQL:</para>\r
-                               <para><ulink url="http://www.postgresql.org/docs/8.4/static/install-upgrading.html" /></para>\r
-                               <para><ulink url="http://www.postgresql.org/docs/8.4/interactive/textsearch-migration.html" /> \r
-                               </para>\r
-                               <para><ulink url="http://www.postgresql.org/docs/current/static/tsearch2.html#AEN102824" /></para>\r
-                       </step>\r
-               </procedure>\r
+psql -f /usr/share/postgresql/9.0/contrib/tablefunc.sql evergreen\r
+psql -f /usr/share/postgresql/9.0/contrib/tsearch2.sql  evergreen\r
+psql -f /usr/share/postgresql/9.0/contrib/pgxml.sql     evergreen\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Update the 8.4 cluster (with evergreen database) to 9.0.</para>\r
+<screen><userinput>                            \r
+pg_upgradecluster 8.4 main\r
+</userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>as the <systemitem class="username">postgres</systemitem> user, load data from backup into PostgreSQL 9.0.</para>\r
+<screen><userinput><![CDATA[                           \r
+psql < data\r
+]]></userinput></screen>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Restart Evergreen and Apache.</para>\r
+                               </step>\r
+                               <step>\r
+                                       <para>Test by logging into psql, checking the postgrSQL version and running a simple SELECT query.</para>\r
+<screen><userinput>    \r
+psql -U evergreen                      \r
+evergreen=# select version();\r
+evergreen=# select count(*) from biblio.record_entry;\r
+</userinput></screen>\r
+                               </step>\r
+                       </procedure>\r
+               </simplesect>\r
        </section>\r
 </chapter>\r
index 2fd41c2..3b4c5a6 100644 (file)
@@ -487,7 +487,7 @@ CREATE TABLE students (
                                possibilities.</para> \r
                                <para> <database class="field">ident_type</database> is the identification type used for identiying users. This is a integer value referencing \r
                                <database class="table">config.identification_type</database> and should match the id values of that table. The default values are \r
-                               <literal>1</literal> for Drivers License, <literal>2</literal>for SSN or <literal>3</literal>for other.</para>\r
+                               <literal>1</literal> for Drivers License, <literal>2</literal> for SSN or <literal>3</literal> for other.</para>\r
                                <para><database class="field">home_ou</database> is the home organizational unit for the user. This value needs to match the corresponding \r
                                <database class="field">id</database> in the <link linkend="actor.table.org-unit"><database class="table">actor.org_unit</database></link> \r
                                table.</para>    \r