<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Upgrading Platform components</title><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="upgrade.html" title="Chapter�5.�Upgrading"><link rel="previous" href="upgrade-openacs-files.html" title="Upgrading the OpenACS files"><link rel="next" href="maintenance.html" title="Chapter�6.�Maintenance"><link rel="stylesheet" href="openacs.css" type="text/css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" border="0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="upgrade-openacs-files.html">Prev</a> </td><th width="60%" align="center">Chapter�5.�Upgrading</th><td width="20%" align="right"> <a accesskey="n" href="maintenance.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="upgrade-supporting"></a>Upgrading Platform components</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="upgrade-openfts-0.2-to-0.3.2"></a>Upgrading OpenFTS from 0.2 to 0.3.2</h3></div></div><div></div></div><p>OpenACS Full Text Search requires several pieces: the OpenFTS code, some database functions, and the OpenFTS Engine. This section describes how to upgrade OpenFTS from 0.2 to 0.3.2 and upgrade the search engine on an OpenACS site at the same time.</p><div class="orderedlist"><ol type="1"><li><p>Uninstall the old OpenFTS Engine from the <span class="replaceable"><span class="replaceable">service0</span></span> database.</p><div class="orderedlist"><ol type="a"><li><p><span class="bold"><b>Browse to <tt class="computeroutput">http://<span class="replaceable"><span class="replaceable">yourserver</span></span>/openfts</tt>.</b></span> </p></li><li><p><span class="bold"><b>Click <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Administration</span></span></tt>.</b></span></p></li><li><p><span class="bold"><b>Click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">Drop OpenFTS Engine</span></span></tt></b></span></p></li></ol></div></li><li><p>Build and install the new OpenFTS driver and supporting tcl procedures. (This section of shell code is not fully documented; please exercise care.)</p><pre class="screen">cd /usr/local/src/ tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz chown -R root.root Search-OpenFTS-tcl-0.3.2/ cd Search-OpenFTS-tcl-0.3.2/ ./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver --with-tcl=/usr/lib/ cd aolserver/ make </pre><p> Back up the old fts driver as a precaution and install the newly compiled one</p><pre class="screen">mv /usr/local/aolserver/bin/nsfts.so /usr/local/aolserver/bin/nsfts-0.2.so cp nsfts.so /usr/local/aolserver/bin </pre><p>Build and install the OpenFTS code for PostGresSQL</p><pre class="screen">cd /usr/local/src/Search-OpenFTS-tcl-0.3.2/ cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.2.3/contrib /usr/local/src/postgresql-7.2.3/contrib/pgsql_contrib_openfts make su - postgres cd tsearch/ make make install exit</pre><p>In order for the OpenACS 4.6 OpenFTS Engine to use the OpenFTS 0.3.2 driver, we need some commands added to the database.</p><pre class="screen">[root root]# <b class="userinput"><tt>su - <span class="replaceable"><span class="replaceable">service0</span></span></tt></b> [service0 dev]$ <b class="userinput"><tt>psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/pgsql/share/contrib/openfts.sql</tt></b> CREATE CREATE [service0 dev]$ <b class="userinput"><tt>psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql</tt></b> BEGIN CREATE (~30 more lines) [service0 dev]$ <b class="userinput"><tt>exit</tt></b> [root root]# <span class="action"><span class="action">su - <span class="replaceable"><span class="replaceable">service0</span></span> psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/pgsql/share/contrib/openfts.sql psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql exit</span></span></pre></li><li><p><b>OPTIONAL: Install the new OpenFTS Engine.�</b>If you want to upgrade the OpenFTS Engine, do these steps. (You must have already upgraded the OpenFTS driver to 0.3.2.)</p><div class="orderedlist"><ol type="a"><li><p>Browse to <tt class="computeroutput">http://<span class="replaceable"><span class="replaceable">yourserver</span></span>/admin/site-map</tt></p></li><li><p>On the <tt class="computeroutput">openfts</tt> line, click on <tt class="computeroutput"><span class="guilabel"><span class="guilabel">set parameters</span></span></tt>.</p></li><li><p>Change the value of <tt class="computeroutput">openfts_tcl_src_path</tt> from <tt class="computeroutput">/usr/local/src/Search-OpenFTS-tcl-0.2/</tt> to <tt class="computeroutput">/usr/local/src/Search-OpenFTS-tcl-0.3.2/</tt></p></li><li><p>Click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">Set Parameters</span></span></tt></p></li><li><pre class="screen">[root root]# restart-aolserver <span class="replaceable"><span class="replaceable">service0</span></span></pre></li><li><p>Browse to <tt class="computeroutput">http://<span class="replaceable"><span class="replaceable">yourserver</span></span>/openfts</tt></p></li><li><p><span class="bold"><b>Click <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Administration</span></span></tt>.</b></span></p></li><li><p><span class="bold"><b>Click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">Initialize OpenFTS Engine</span></span></tt></b></span></p></li></ol></div></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="upgrade-postgres-7.2-to-7.3"></a>Upgrading from PostGreSQL 7.2 to 7.3</h3></div></div><div></div></div><p>An OpenACS database created in PostGreSQL 7.2 will not work correctly in PostGreSQL 7.3. This is because 7.2 truncates function names to 31 characters, but 7.3 does not. This does not cause problems in 7.2, because truncation occurs both at function creation and at function calling, so they still match. But if you use a database created in 7.2 in 7.3, the function names in the database remain truncated but the function calls are not, and so they don't match. Also some functions use casting commands that no longer work in 7.3 and these functions must be recreated.</p><p> To upgrade an OpenACS site from PostGreSQL 7.2 to 7.3, first upgrade the kernel to 4.6.3. Then, dump the database, run the upgrade script <tt class="computeroutput">/var/lib/aolserver/<span class="replaceable"><span class="replaceable">service0</span></span>/bin/pg_7.2to7.3_upgrade_helper.pl</tt> on the dump file, and reply the dump. See <a href="http://openacs.org/forums/message-view?message_id=109337" target="_top">Forum OpenACS Q&A: PG 7.2->7.3 upgrade gotcha?</a>. Example:</p><div class="orderedlist"><ol type="1"><li><p>Back up the database as per <a href="backup-recovery.html#postgres-snapshot-backup" title="PostgreSQL">PostgreSQL</a>.</p></li><li><p>Run the upgrade script on the backup file.</p><pre class="screen">[root root]# <b class="userinput"><tt>su - <span class="replaceable"><span class="replaceable">service0</span></span></tt></b> [service0 <span class="replaceable"><span class="replaceable">service0</span></span>]# <b class="userinput"><tt>cd /var/lib/aolserver/<span class="replaceable"><span class="replaceable">service0</span></span>/bin</tt></b> [service0 bin]$ <b class="userinput"><tt>./pg_7.2to7.3_upgrade_helper.pl \ ../database-backup/nightly.dmp \ ../database-backup/upgrade-7.3.dmp \ /var/lib/aolserver/<span class="replaceable"><span class="replaceable">service0</span></span></tt></b> ================================================================== looking for function acs_object__check_object_ancest in oacs grep result: /var/lib/aolserver/aufrecht-dev/packages/acs-kernel/sql/postgresql/acs-objects-create.sql:create function acs_object__check_object_ancestors (integer,integer,integer) replacing acs_object__check_object_ancest with acs_object__check_object_ancestors <span class="emphasis"><em>(many lines omitted)</em></span> [service0 bin]$ </pre></li><li><p>Use perl to replace <tt class="computeroutput">timestamp</tt> with <tt class="computeroutput">timestamptz</tt> in the dump file.</p><pre class="programlisting">find . -type f -name "*sql" | xargs perl -p -i.tmp -e "s/timestamp with time zone/timestamptz/g" find . -type f -name "*sql" | xargs perl -p -i.tmp -e "s/\\wtimestamp[^t]/ timestamptz/g"</pre></li><li><p>Restore the database from dump as per the <a href="backup-recovery.html#restore-postgres">recovery instructions</a>.</p></li></ol></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="upgrade-openacs-files.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="maintenance.html">Next</a></td></tr><tr><td width="40%" align="left">Upgrading the OpenACS files </td><td width="20%" align="center"><a accesskey="u" href="upgrade.html">Up</a></td><td width="40%" align="right"> Chapter�6.�Maintenance</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/upgrade-supporting.html#comments">View comments on this page at openacs.org</a></center></body></html>