source: trunk/doc/src/docbook/admin/installation.xml @ 7521

Last change on this file since 7521 was 7521, checked in by Nicklas Nordborg, 4 years ago

References #2130: Upgrade 3-rd party libraries

Removed the need for a db.driver setting in base.config since the driver can be automatically loaded from the db.url setting (using DriverManagager.getDriver(url)).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 60.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC
3    "-//Dawid Weiss//DTD DocBook V3.1-Based Extension for XML and graphics inclusion//EN"
4    "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd">
5<!--
6  $Id: installation.xml 7521 2018-11-06 08:00:49Z nicklas $
7
8  Copyright (C) 2007 Jari Häkkinen, Peter Johansson, Nicklas Nordborg, Martin Svensson
9  Copyright (C) 2008 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
10  Copyright (C) 2009 Jari Häkkinen, Nicklas Nordborg
11  Copyright (C) 2010, 2011, 2012 Nicklas Nordborg
12  Copyright (C) 2013 Jari Häkkinen, Nicklas Nordborg
13
14  This file is part of BASE - BioArray Software Environment.
15  Available at http://base.thep.lu.se/
16
17  BASE is free software; you can redistribute it and/or
18  modify it under the terms of the GNU General Public License
19  as published by the Free Software Foundation; either version 3
20  of the License, or (at your option) any later version.
21
22  BASE is distributed in the hope that it will be useful,
23  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  GNU General Public License for more details.
26
27  You should have received a copy of the GNU General Public License
28  along with BASE. If not, see <http://www.gnu.org/licenses/>.
29-->
30
31<chapter id="installation">
32
33  <title>Installation and upgrade instructions</title>
34
35  <note>
36    <para>
37    These instructions apply only to the BASE release which this
38    document is a part of. The instructions here assume
39    that <ulink url="http://tomcat.apache.org/">Apache Tomcat 8</ulink> is used
40    on the server side. Other servlet engines may work but we only
41    test with Tomcat.
42    </para>
43  </note>
44
45  <sect1 id="installation.upgrade">
46    <title>Upgrade instructions</title>
47
48    <important id="installation.upgrade.important">
49      <title>Important information for upgrading to BASE 3.14</title>
50      <para>
51        This section list some important information that may or may not
52        apply when upgrading from the <emphasis>previous</emphasis> BASE
53        release to the current release (eg. 3.13 to 3.14). If you are
54        upgrading from a BASE installation that is older (3.0-3.12)
55        you should also read <xref linkend="appendix.update_warnings" />.
56      </para>
57
58      <bridgehead>The db.driver setting is no longer used</bridgehead>
59      <para>
60        The JDBC driver to use is now found automatically based on
61        the <constant>db.url</constant> setting in the <filename>base.config</filename>
62        file. The <constant>db.driver</constant> setting can be removed.
63      </para>
64    </important>
65   
66    <para>
67      As always, backup your database before attempting an
68      upgrade. The BASE team performs extensive testing before
69      releasing a new version of BASE but there are always a
70      possibility for unexpected events during upgrades. In upgrades
71      requiring a change in the underlying database there is no
72      (supported) way to revert to a previous version of BASE using
73      BASE tools, you need to use your backup for this use case.
74    </para>
75
76    <para>
77      The strategy here is to install the new BASE release to another
78      directory than the one in use. This requires transfer of
79      configuration settings to the new install but more on that
80      below.
81    </para>
82
83    <variablelist>
84      <varlistentry>
85        <term>Shut down the Tomcat server</term>
86        <listitem>
87          <para>
88            If the BASE application is not shut down already, it is
89            time to do it now. Do something like <command>sudo
90            /etc/init.d/tomcat8.0 stop</command>
91          </para>
92         
93          <tip>
94            <title>Notify logged in users!</title>
95            <para>
96              If there are users logged in to your BASE server, it may
97              be nice of you to notify them a few minutes prior to shutting
98              down the BASE server. See <xref linkend="installation.broadcast" />.
99            </para>
100          </tip>
101        </listitem>
102      </varlistentry>
103
104      <varlistentry>
105        <term>Rename your current server</term>
106        <listitem>
107          <para>
108            Rename your current BASE installation <command>mv
109              /path/to/base /path/to/base_old</command>.
110          </para>
111        </listitem>
112      </varlistentry>
113
114      <varlistentry>
115        <term>Download and unpack BASE</term>
116        <listitem>
117          <para>
118            There are several ways to download BASE. Please refer to
119            section <xref linkend="resources.home_page.download"/> for
120            information on downloading BASE, and select the item
121            matching your download option:
122          </para>
123
124          <variablelist>
125            <varlistentry>
126              <term><emphasis>Pre-compiled package</emphasis></term>
127              <listitem>
128                <para>
129                  If you selected to download a pre-compiled package,
130                  unpack the downloaded file with <command>tar zxpf
131                  base-...tar.gz</command>.
132                </para>
133              </listitem>
134            </varlistentry>
135
136            <varlistentry>
137              <term><emphasis>Source package</emphasis></term>
138              <listitem>
139                <para>
140                  If you selected to download a source package, unpack
141                  the downloaded file with <command>tar zxpf
142                  base-...src.tar.gz</command>. Change to the new
143                  directory, and issue <command>ant
144                  package.bin</command>. This will create a binary
145                  package in the current directory. Unpack this new
146                  package (outside of the source file hierarchy).
147                </para>
148              </listitem>
149            </varlistentry>
150
151            <varlistentry>
152              <term><emphasis>Subversion checkout</emphasis></term>
153              <listitem>
154                <para>
155                  This option is for advanced users only and is not
156                  covered here. Please refer to
157                  <ulink url="http://base.thep.lu.se/wiki/BuildingBase" /> for information on
158                  this download option.
159                </para>
160              </listitem>
161            </varlistentry>
162
163          </variablelist>
164        </listitem>
165
166      </varlistentry>
167
168      <varlistentry>
169        <term>Transfer files and settings</term>
170        <listitem>
171          <para>
172            Settings from the previous installation must be
173            transferred to the new installation. This is most easily
174            done by comparing the configuration files from the
175            previous install with the new files. Do not just copy the
176            old files to the new install since new options may have
177            appeared.
178          </para>
179          <para>
180            In the main BASE configuration file,
181            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>,
182            fields that needs to be transferred are usually
183            <emphasis>db.username</emphasis>,
184            <emphasis>db.password</emphasis>,
185            and <emphasis>userfiles</emphasis>.
186          </para>
187          <para>
188            Local settings in the raw data
189            tables, <filename>&lt;base-dir&gt;/www/WEB-INF/classes/raw-data-types.xml</filename>,
190            may need to be transferred. This also includes all files in
191            the <filename>&lt;base-dir&gt;/www/WEB-INF/classes/raw-data-types</filename> and
192            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/extended-properties</filename>
193            directories.
194          </para>
195        </listitem>
196      </varlistentry>
197
198      <varlistentry>
199        <term>Updating database schema</term>
200        <listitem>
201          <para>
202            It is recommended that you also perform an update of your
203            database schema.  Running the update scripts are not
204            always necessary when upgrading BASE, but the running the
205            update scripts are safe even in cases when there is no
206            need to run them. Change directory
207            to <filename
208            class="directory">&lt;base-dir&gt;/bin/</filename> and issue
209<programlisting>
210sh ./updatedb.sh [base_root_login] <emphasis>base_root_password</emphasis>
211</programlisting>
212            where <emphasis>base_root_login</emphasis> is the login
213            for the root user and <emphasis>base_root_password</emphasis> is the
214            password. The login is optional. If not specified,
215            <constant>root</constant> is used as the login.
216          </para>
217        </listitem>
218      </varlistentry>
219
220      <varlistentry>
221        <term>Start Tomcat</term>
222        <listitem>
223          <para>
224            Start the Tomcat server: <command>sudo
225              /etc/init.d/tomcat8.0 start</command>
226          </para>
227        </listitem>
228      </varlistentry>
229
230    </variablelist>
231
232    <para>
233      Done! Upgrade of BASE is finished.
234    </para>
235
236  </sect1>      <!-- Upgrade instructions -->
237
238  <sect1 id="installation.main">
239    <title>Installation instructions</title>
240
241    <variablelist>
242
243      <varlistentry>
244        <term>Java</term>
245        <listitem>
246          <para>
247            Download and install Java SE 8, available from
248            <ulink url="http://www.oracle.com/technetwork/java/javase/downloads/index.html" />.
249            You can select either the JDK or the JRE version.
250          </para>
251         
252          <note>
253            <para>
254            As of BASE 3.6 only Java SE 8 is supported. Java SE 7
255            or lower is not supported. Java 11 is not yet officially
256            supported. It may work, but it requires an extra installation
257            step: Copy the JAR-files located in <filename>&lt;base-dir&gt;/misc/java11/</filename>
258            to the <filename>&lt;base-dir&gt;/www/WEB-INF/lib/</filename> directory.
259            </para>
260          </note>
261
262        </listitem>
263      </varlistentry>
264
265      <varlistentry>
266        <term>Set up an SQL database</term>
267        <listitem>
268          <para>
269            BASE
270            utilise <ulink
271            url="http://www.hibernate.org/">Hibernate</ulink> for
272            object persistence to a relational database. Hibernate
273            supports many database engines, but so far we only work
274            with <ulink url="http://www.mysql.com">MySQL</ulink>
275            and <ulink
276            url="http://www.postgresql.org/">PostgreSQL</ulink>.
277          </para>
278
279          <variablelist>
280            <varlistentry>
281              <term>MySQL</term>
282              <listitem>
283                <para>
284                  Download and install MySQL (tested with version
285                  5.5), available from
286                  <ulink url="http://www.mysql.com/" />. You need to
287                  be able to connect to the server over TCP, so
288                  the <emphasis>skip-networking</emphasis> option
289                  must <command>not</command> be used. The InnoDB
290                  table engine is also needed, so do not disable them
291                  (not that you would) but you may want to tune the
292                  InnoDB behaviour before creating BASE
293                  databases. BASE comes pre-configured for MySQL so
294                  there is no need to change database settings in the
295                  BASE configuration files.
296                </para>
297              </listitem>
298            </varlistentry>
299            <varlistentry>
300              <term>PostgreSQL</term>
301              <listitem>
302                <para>
303                  PostgreSQL 9.3 seems to be working very well with
304                  BASE and Hibernate. Download and install PostgreSQL,
305                  available from
306                  <ulink url="http://www.postgresql.org/" />. You must edit
307                  your <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>
308                  file. Uncomment the settings for PostgreSQL and
309                  comment out the settings for MySQL.
310                </para>
311              </listitem>
312            </varlistentry>
313          </variablelist>
314
315        </listitem>
316      </varlistentry>
317
318      <varlistentry id="installation.main.database">
319        <term>BASE (database engine)</term>
320        <listitem>
321          <para>
322            The database names (base2 and base2dynamic are used here),
323            the <emphasis>db_user</emphasis>, and the
324            <emphasis>db_password</emphasis> can be changed during the
325            creation of the databases. It is recommended to change the
326            <emphasis>db_password</emphasis>, the other changes are
327            optional and can be made if desired. The database names,
328            the <emphasis>db_user</emphasis>, and the
329            <emphasis>db_password</emphasis> are needed below when
330            configuring BASE.
331          </para>
332          <note>
333            Note that the <emphasis>db_user</emphasis> name and
334            <emphasis>db_password</emphasis> set here is used
335            internally by BASE in communication with the database and
336            is never used to log on to the BASE application.
337          </note>
338          <important>
339            <title>The database must use the UTF-8 character set</title>
340            <para>
341              Otherwise there will be a problem with storing values
342              that uses characters outside the normal Latin1 range,
343              for example unit-related such as µ (micro) and Ω (ohm).
344            </para>
345          </important>
346          <variablelist>
347            <varlistentry>
348              <term>MySQL</term>
349              <listitem>
350                <para>
351                  Create a new database for BASE, and add a
352                  <emphasis>db_user</emphasis> with at least
353                  <emphasis>SELECT</emphasis>, <emphasis>INSERT</emphasis>,
354                  <emphasis>UPDATE</emphasis>, <emphasis>DELETE</emphasis>,
355                  <emphasis>CREATE</emphasis>, <emphasis>DROP</emphasis>,
356                  <emphasis>INDEX</emphasis>,
357                  and <emphasis>ALTER</emphasis> permission for the
358                  new database. To do this, connect to your MySQL
359                  server and issue the next lines:
360<programlisting>CREATE DATABASE base2 DEFAULT CHARACTER SET utf8;
361CREATE DATABASE base2dynamic DEFAULT CHARACTER SET utf8;
362GRANT ALL ON base2.* TO db_user@localhost IDENTIFIED BY 'db_password';
363GRANT ALL ON base2dynamic.* TO db_user@localhost;</programlisting>
364                </para>             
365                <para>
366                  If you download BASE (instructions below) you find a file
367                  <filename>&lt;base-dir&gt;/misc/sql/createdb.mysql.sql</filename>
368                  that contains the above statements and can be used
369                  by the <filename>mysql</filename> command-line tool
370                  (remember to edit the <emphasis>db_user</emphasis>,
371                  <emphasis>db_password</emphasis>, and the database
372                  names in the script file before executing the
373                  command): <command>mysql -uroot -p &lt;
374                  &lt;base-dir&gt;/misc/sql/createdb.mysql.sql</command>. The
375                  header in the script file contains further
376                  information about the script.
377                </para>
378              </listitem>
379            </varlistentry>
380            <varlistentry>
381              <term>PostgreSQL</term>
382              <listitem>
383                <para>
384                  Create a new database for BASE, and add a
385                  <emphasis>db_user</emphasis> with the proper
386                  privileges. To do this, log in as your PostgreSQL
387                  user and issue these lines (omit comments):
388<programlisting>createuser db_user -P
389  # this will prompt for an password for the new user, and issue two
390  # more question that should be answered with character 'n' for no.
391createdb --owner db_user --encoding UTF8 base2
392psql base2
393  # this will start the psql command line tool. Issue the next line
394  # within the tool and quit with a '\q'.
395CREATE SCHEMA "dynamic" AUTHORIZATION "db_user";</programlisting>
396
397                  If you download BASE (instructions below) you find a file
398                  <filename>&lt;base-dir&gt;/misc/sql/createdb.postgresql.sql</filename>
399                  that contains the above statements and can be used
400                  by the <filename>psql</filename> command-line tool:
401                  <command>psql -f
402                  &lt;base-dir&gt;/misc/sql/createdb.posgres.sql
403                  template1</command> The header in the script file
404                  contains further information about the script.
405                </para>
406              </listitem>
407            </varlistentry>
408          </variablelist>
409        </listitem>
410      </varlistentry>
411
412      <varlistentry>
413        <term>BASE (download and unpacking)</term>
414        <listitem>
415          <para>
416            <ulink
417            url="http://base.thep.lu.se/wiki/DownloadPage">Download
418            BASE</ulink> and unpack the downloaded file,
419            i.e. <command>tar zxpf base-...tar.gz</command>. If you
420            prefer to have the bleeding edge version of BASE, perform
421            a checkout of the source from the subversion repository
422            (subversion checkout instructions at
423            <ulink url="http://base.thep.lu.se/wiki/DownloadPage">BASE
424            trac site</ulink>).
425          </para>
426          <para>
427            If you choose to download the binary package, skip to the
428            next item. The rest of us, read on and compile BASE. If
429            you downloaded a source distribution, unpack the
430            downloaded file <command>tar zxpf
431            base-...src.tar.gz</command>, or you may have performed a
432            subversion checkout.  Change to the 'root' base2
433            directory, and issue <command>ant
434            package.bin</command>. This will create a binary package
435            in the base2 'root' directory. Unpack this new package
436            (outside of the source file hierarchy), and from now on
437            the instructions are the same irrespective where you got
438            the binary package.
439          </para>
440          <para>
441            <emphasis>This section is intended for advanced users and
442              programmers only. In cases when you want to change the
443              BASE code and try out personalised features it may be
444              advantageous to run the tweaked BASE server against the
445              development tree. Instructions on how to accomplish this
446              is available in the
447              <ulink
448              url="http://base.thep.lu.se/wiki/BuildingBase">building
449              BASE document</ulink>. When you return back after
450              compiling in the subversion tree you can follow the
451              instruction here (with obvious changes to
452              paths).</emphasis>
453          </para>
454        </listitem>
455      </varlistentry>
456
457      <varlistentry>
458        <term>BASE (file storage setup)</term>
459        <listitem>
460          <para>
461            An area for file storage must be setup. Create an empty
462            directory in a proper location in your file system. Set
463            the owner of the created directory to the user the Tomcat
464            server will be running as. Tomcat server set up
465            instructions will follow below. Remember this location for
466            later use. The default location is <filename>/usr/local/base2/files</filename>.
467          </para>
468        </listitem>
469      </varlistentry>
470     
471      <varlistentry>
472        <term>BASE (plug-in setup)</term>
473        <listitem>
474          <para>
475            An area for plug-in and extensions installation must be setup.
476            Create an empty directory in a proper location in your file system,
477            and make sure that the user that the Tomcat
478            server will be running as has read permission in this
479            directory. Tomcat server set up instructions will follow
480            below. Remember this location for
481            later use. The default location is <filename>/usr/local/base2/plugins</filename>.
482          </para>
483        </listitem>
484      </varlistentry>
485
486      <varlistentry id="installation.main.configuration">
487        <term>BASE (configuration)</term>
488        <listitem>
489          <para>
490            Basic BASE configuration is done in
491            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>:
492            <itemizedlist>
493              <listitem>
494                Uncomment the database engine section that match your setup.
495              </listitem>
496              <listitem>
497                Modify the <emphasis>db.url</emphasis>,
498                <emphasis>db.dynamic.catalog</emphasis>,
499                <emphasis>db.username</emphasis>,
500                and <emphasis>db.password</emphasis> settings to match
501                your choice above. (<emphasis>database host and
502                database name (e.g. base2)</emphasis>,
503                <emphasis>e.g. base2dynamic</emphasis>,
504                <emphasis>db_user</emphasis>, and
505                <emphasis>db_password</emphasis>, respectively.)
506              </listitem>
507              <listitem>
508                Modify the <emphasis>userfiles</emphasis> setting to
509                match your choice in file storage setup above.
510              </listitem>
511              <listitem>
512                Modify the <emphasis>plugins.dir</emphasis> setting to
513                match your choice in plug-in setup above.
514              </listitem>
515            </itemizedlist>
516            See the <xref linkend="appendix.base.config"/> for more
517            information about the settings in
518            the <filename>base.config</filename> file.
519          </para>
520          <para>
521            <emphasis>Optional but recommended.</emphasis> You may want
522            to modify extended properties to fit your needs. Extended
523            properties are defined in
524            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/extended-properties.xml</filename>.
525            There is an
526            administrator <ulink
527            url="http://base.thep.lu.se/chrome/site/doc/historical/admin/extended-properties.html">document
528            discussing extended properties</ulink> available. If you
529            plan to perform a migration of a BASE version 1.2 database you
530            should probably not remove any extended properties
531            columns (this is not tested so the outcome is currently
532            undefined). However, adding columns does not affect
533            migration.
534          </para>
535        </listitem>
536      </varlistentry>
537
538      <varlistentry>
539        <term>BASE (database initialisation)</term>
540        <listitem>
541          <para>
542            Change directory to
543            <filename class="directory">&lt;base-dir&gt;/bin</filename>
544            and execute the following commands:
545        <programlisting>
546sudo ./initdb.sh [base_root_login] base_root_password
547</programlisting>
548          </para>
549
550          <para>
551            In the first command sudo is required because a file will
552            be created in the directory defined by
553            <emphasis>userfiles</emphasis> above. If the directory is
554            writable by you then sudo is not needed.
555          </para>
556
557          <important>
558            <para>
559            The <emphasis>base_root_login</emphasis> and
560            <emphasis>base_root_password</emphasis> you use here
561            is given to the BASE web application root user account.
562            The <emphasis>base_root_login</emphasis> is optional. If
563            not specified, <constant>root</constant> is used for
564            the login.
565            </para>
566          </important>
567
568          <para>
569            If the initialisation script fails, it is probably a
570            problem related to the underlying database. Make sure that
571            the database accepts network connection and make sure that
572            <emphasis>db_user</emphasis> has proper credentials. You
573            may also get a <emphasis>Permission denied</emphasis> on
574            file <filename>extension-settings.xml</filename> if you do
575            not have write permission to the directory defined by
576            variable <emphasis>userfiles</emphasis> in file
577            <filename>base.config</filename>. If the initialisation
578            fails on <filename>extension-settings.xml</filename> you
579            must drop the database and recreate the database as
580            described in <xref linkend="installation.main.database"/>.
581          </para>
582        </listitem>
583      </varlistentry>
584
585      <varlistentry>
586        <term>Tomcat</term>
587        <listitem>
588          <para>
589            Download and install Apache Tomcat 8
590            available from <ulink url="http://tomcat.apache.org" />.
591          </para>
592
593          <important>
594            <para>
595              As of BASE 3.6 we are only supporting Tomcat 8.
596              Tomcat 7 may work, but there is no guarantee.
597            </para>
598          </important>
599
600          <para>
601            There are a few configuration options that are needed to
602            make Tomcat work properly with BASE. The options are set in the
603            <code>CATALINA_OPTS</code> environment variable.
604          </para>
605         
606          <itemizedlist>
607            <listitem>
608              <para>
609                Increase the amount of memory that Tomcat is allowed to use. The default setting is
610                usually not enough. To give Tomcat 1 gigabyte, use <code>-Xmx1G</code>.
611              </para>
612            </listitem>
613            <listitem>
614              <para>
615                Disable strict parsing of JSP files.
616                <code>-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false</code>
617              </para>
618            </listitem>
619            <listitem>
620              <para>
621                Unless you have manually downloaded and installed JAI (Java Advanced
622                Imaging) native acceleration libraries (see <ulink 
623                url="http://java.sun.com/javase/technologies/desktop/media/jai/" />)
624                it is a good idea to disable the native acceleration of JAI.
625                <code>-Dcom.sun.media.jai.disableMediaLib=true</code>
626              </para>
627            </listitem>
628            <listitem>
629              <para>
630                Enable headless mode if your are setting up a server which doesn't have
631                a display device connected to it. <code>-Djava.awt.headless=true</code>.
632              </para>
633            </listitem>
634          </itemizedlist>
635         
636          <para>
637            Depending on your system there are probably several ways to set the
638            the <code>CATALINA_OPTS</code> variable. One suggestion is to add the following
639            line (as a single line) close to the top of the <filename>catalina.sh</filename> 
640            script that comes with Tomcat (directory <filename
641            class="directory">bin</filename>):
642<programlisting>CATALINA_OPTS="-Xmx1G
643-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
644-Dcom.sun.media.jai.disableMediaLib=true
645-Djava.awt.headless=true"</programlisting>
646          </para>
647          <para>
648            For more information about Tomcat options see
649            <ulink url="http://tomcat.apache.org/tomcat-8.0-doc/index.html" />.
650          </para>
651        </listitem>
652      </varlistentry>
653
654      <varlistentry>
655        <term>BASE and Tomcat</term>
656        <listitem>
657          <para>
658            Do the following:
659            <itemizedlist>
660              <listitem>
661                <para>
662                  Either move the <filename
663                  class="directory">&lt;base-dir&gt;/www</filename>
664                  directory to the Tomcat <filename
665                  class="directory">webapps</filename> directory or
666                  create a symbolic link from the Tomcat <filename
667                  class="directory">webapps</filename> directory to
668                  the <filename
669                  class="directory">&lt;base-dir&gt;/www</filename>
670                  directory
671<programlisting>cd /path/to/tomcat/webapps
672ln -s /path_to_base/www base2</programlisting>
673                </para>
674              </listitem>
675              <listitem>
676                <para>
677                  Make sure that user Tomcat is running as can read
678                  all objects in the directory defined by
679                  <emphasis>plugins.dir</emphasis> in file
680                  <filename>base.config</filename>.
681                </para>
682              </listitem>
683              <listitem>
684                <para>
685                  Make sure that user Tomcat is running as owns (i.e.,
686                  can read, write, delete and create) all objects in
687                  the directory, as well as the directory itself,
688                  defined by <emphasis>userfiles</emphasis> in file
689                  <filename>base.config</filename>.
690                </para>
691              </listitem>
692              <listitem>
693                <para>
694                  If you plan to install extensions you should make
695                  sure that the <filename
696                  class="directory">&lt;base-dir&gt;/www/extensions</filename>
697                  directory is writable by the user account Tomcat is
698                  running as.
699                </para>
700              </listitem>
701            </itemizedlist>
702          </para>
703          <para>
704            and finalise with start, or restart, Tomcat, and try
705            http://hostname:8080/base2 (change
706            <emphasis>hostname</emphasis> to your hostname and
707            <emphasis>base2</emphasis> if you selected another name
708            for the BASE Tomcat application) in your favourite
709            browser. The BASE log-in page should appear after a few
710            seconds.
711          </para>
712        </listitem>
713      </varlistentry>
714
715      <varlistentry>
716        <term>BASE, Apache, and Apache/Tomcat connector</term>
717        <listitem>
718          <para>
719            <emphasis>This step is optional</emphasis>.
720          </para>
721          <para>
722            If you want run the Tomcat server through the Apache web
723            server, you need to install the Apache version 2 web
724            server, available
725            from <ulink url="http://httpd.apache.org/" />,
726            and a apache-tomcat connector, available
727            from <ulink
728            url="http://tomcat.apache.org/connectors-doc/index.html" />
729          </para>
730        </listitem>
731      </varlistentry>
732
733      <varlistentry>
734        <term>Setup done!</term>
735        <listitem>
736          <para>
737            Happy BASEing. Now you can log on to your BASE server as
738            user <emphasis>root</emphasis> (use
739            the <emphasis>base_root_password</emphasis> from the
740            database initialisation step above). You should begin with
741            creating a couple user accounts, for more information on
742            how to create user accounts please refer to
743            <xref linkend="accounts"/>.
744          </para>
745        </listitem>
746      </varlistentry>
747
748    </variablelist>
749
750  </sect1>      <!-- Installation instructions -->
751
752  <sect1 id="installation.jobagents">
753    <title>Installing job agents</title>
754
755    <para>
756      It is important to understand that the BASE application can be
757      spread on to several computers. The main BASE application is
758      serving HTTP requests, the underlying database engine is
759      providing storage and persistence of data, and job agents can be
760      installed on computers that will serve the BASE installation
761      with computing power and perform analysis and run plug-ins. In a
762      straight forward setup one computer provides all services needed
763      for running BASE. From this starting point it is easy to add
764      computers to shares load from the BASE server by installing job
765      agents on these additional computers.
766    </para>
767
768    <para>
769      A job agent is a program running on a computer regularly
770      checking the BASE job queue for jobs awaiting execution. When
771      the job agent finds a job that it is enabled to execute, it
772      loads the plug-in and executes it. Job agents will in this way
773      free up resources on the BASE application server, and thus allow
774      the BASE server to concentrate on serving web pages. Job agents
775      are optional and must be installed and setup
776      separately. However, BASE is prepared for job agent setup and to
777      utilise the agents, but the agent are not required.
778    </para>
779
780    <para>
781      A job agent supports many configuration options that are not
782      supported by the internal job queue. For example, you can
783      <itemizedlist>
784        <listitem>
785          <para>
786            Specify exactly which plug-ins each job agent should be
787            able to execute.
788          </para>
789        </listitem>
790        <listitem>
791          <para>
792            Give some plug-ins higher priority than other plug-ins.
793          </para>
794        </listitem>
795        <listitem>
796          <para>
797            Specify which users/groups/projects should be able to use
798            a specific job agent.
799          </para>
800        </listitem>
801        <listitem>
802          <para>
803            Override memory settings and more for each plug-in.
804          </para>
805        </listitem>
806        <listitem>
807          <para>
808            Execute plug-ins in separate processes. Thus, a misbehaving
809            plug-in cannot bring the main application server down.
810          </para>
811        </listitem>
812        <listitem>
813          <para>
814            Add more computers with job agents as needed.
815          </para>
816        </listitem>
817      </itemizedlist>
818      All these options make it possible to create a very flexible
819      setup. For example one job agent can be assigned for importing
820      data only, another job agent can be assigned for running
821      analysis plug-ins for specific project only, and a third may be a
822      catch-all job agent that performs all low-priority jobs.
823    </para>
824
825    <sect2 id="installation.jobagents.serverside">
826      <title>BASE application server side setup</title>
827      <para>
828        <variablelist>
829          <varlistentry>
830            <term>Make sure the internal job queue doesn't execute all plug-ins</term>
831            <listitem>
832              <para>
833                The setting <command>jobqueue.internal.runallplugins</command>
834                should be set to <command>false</command> for the
835                BASE server. This setting is found in
836                the <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>
837                file. The changes will not take effect until the
838                application server is restarted.
839              </para>
840
841            </listitem>
842          </varlistentry>
843          <varlistentry id="installation.jobagent.user_account">
844            <term>Enable the job agent user account</term>
845            <listitem>
846              <para>
847                During installation of BASE a user account is created
848                for the job agent. This account is used by the job
849                agents to log on to BASE. The account is disabled by
850                default and must be enabled. Enable the account and
851                set a password using the BASE web interface.
852                The same password must also be set in the
853                <filename>jobagent.properties</filename> file, see
854                item
855                <xref linkend="installation.jobagent.client.properties"/>
856                below.
857              </para>
858            </listitem>
859          </varlistentry>
860        </variablelist>
861      </para>
862    </sect2>
863
864    <sect2 id="installation.jobagents.database">
865      <title>Database server setup</title>
866      <para>
867        <variablelist>
868          <varlistentry id="installation.jobagent.database">
869            <term>Create a user account on the database</term>
870            <listitem>
871              <para>
872                This is the similar to granting database access for
873                the BASE server user in the in the regular BASE
874                installation, cf.
875                <xref
876                linkend="installation.main.database"/>.
877                You must create an account in the database that is
878                allowed to connect from the job agent server. MySQL
879                example:
880<programlisting>GRANT ALL ON base2.* TO db_user@job.agent.host IDENTIFIED BY 'db_password';
881GRANT ALL ON base2dynamic.* TO db_user@job.agent.host;</programlisting>
882
883                Replace <command>job.agent.host</command> with the
884                host name of the server that is going to run the job
885                agent. You should also set password. This password is
886                used in item
887                <xref linkend="installation.jobagent.client.config"/>
888                below in job agent server setup. You can use the same
889                database user and password as in the regular database
890                setup.
891              </para>
892            </listitem>
893          </varlistentry>
894        </variablelist>
895      </para>
896    </sect2>
897
898    <sect2 id="installation.jobagents.client">
899      <title>Job agent client setup</title>
900      <para>
901        <variablelist>
902          <varlistentry>
903            <term>Download and unpack a regular BASE distribution</term>
904            <listitem>
905              <para>
906                You <emphasis>must</emphasis> use the same version on
907                the web server and all job agents. You find the
908                downloads at
909                <ulink
910                url="http://base.thep.lu.se/wiki/DownloadPage">http://base.thep.lu.se/wiki/DownloadPage</ulink>
911              </para>
912            </listitem>
913          </varlistentry>
914          <varlistentry id="installation.jobagent.client.config">
915            <term>Edit the <filename>base.config</filename> file</term>
916            <listitem>
917              <para>
918                The <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>
919                file must be configured as in regular BASE
920                installation, cf.
921                <xref
922                linkend="installation.main.configuration"/>,
923                to use the same database as the web server
924                application. The most important settings are
925                <itemizedlist>
926                  <listitem>
927                    <para>
928                      <command>db.username</command>: The database
929                      user you created in item
930                      <xref
931                      linkend="installation.jobagent.database"/>
932                      above.
933                    </para>
934                  </listitem>
935                  <listitem>
936                    <para>
937                      <command>db.password</command>: The password for
938                      the user.
939                    </para>
940                  </listitem>
941                  <listitem>
942                    <para>
943                      <command>db.url</command>: The connection url to
944                      the database.
945                    </para>
946                  </listitem>
947                  <listitem>
948                    <para>
949                      <command>userfiles</command>: The path to the
950                      directory where user files are located. This
951                      directory must be accessible from all job
952                      agents, i.e., by nfs or other file system
953                      sharing method.
954                    </para>
955                  </listitem>
956                  <listitem>
957                    <para>
958                      <command>plugins.dir</command>: The path to the
959                      directory where plug-ins are located. This
960                      directory must be accessible from all job
961                      agents, i.e., by nfs or other file system
962                      sharing method.
963                    </para>
964                  </listitem>
965                </itemizedlist>
966                See the <xref linkend="appendix.base.config"/> for
967                more information about the settings in
968                the <filename>base.config</filename> file.
969              </para>
970            </listitem>
971          </varlistentry>
972          <varlistentry id="installation.jobagent.client.properties">
973            <term>Edit
974            the <filename>jobagent.properties</filename> file</term>
975            <listitem>
976              <para>
977                The <filename>&lt;base-dir&gt;/www/WEB-INF/classes/jobagent.properties</filename>
978                file contains settings for the job agent. The most
979                important ones to specify value for are
980                <itemizedlist>
981                  <listitem>
982                    <para>
983                      <command>agent.password</command>: The password
984                      you set for the job agent user account in item
985                      <xref
986                      linkend="installation.jobagent.user_account"/>
987                      above.
988                    </para>
989                  </listitem>
990                  <listitem>
991                    <para>
992                      <command>agent.id</command>: An ID that must be
993                      unique for each job agent accessing the BASE application.
994                    </para>
995                  </listitem>
996                  <listitem>
997                    <para>
998                      <command>agent.remotecontrol</command>: The
999                      name or ip address of the web server if you want it
1000                      to be able to display info about running
1001                      jobs. The job agent will only allow connections
1002                      from computers specified in this setting.
1003                    </para>
1004                  </listitem>
1005                </itemizedlist>
1006              </para>
1007              <para>
1008                The <filename>jobagent.properties</filename> file
1009                contains many more configuration options. See
1010                the <xref linkend="appendix.jobagent.properties"/> for
1011                more information.
1012              </para>
1013            </listitem>
1014          </varlistentry>
1015          <varlistentry>
1016            <term>Register the job agent</term>
1017            <listitem>
1018              <para>
1019                From the <filename>bin</filename> directory, register
1020                the job agent with
1021                <programlisting>./jobagent.sh register</programlisting>
1022              </para>
1023            </listitem>
1024          </varlistentry>
1025          <varlistentry>
1026            <term>Start the job agent</term>
1027            <listitem>
1028              <para>
1029                From the <filename>bin</filename> directory, start the
1030                job agent with
1031                <programlisting>./jobagent.sh start &amp;</programlisting>
1032              </para>
1033              <para>
1034                See the <xref linkend="appendix.jobagent.sh"/>
1035                for more information about what you can do
1036                with the job agent command line interface.
1037              </para>
1038            </listitem>
1039          </varlistentry>
1040        </variablelist>
1041      </para>
1042    </sect2>
1043
1044
1045    <sect2 id="installation.jobagents.configuration">
1046      <title>Configuring the job agent</title>
1047   
1048      <para>
1049        A job agent will not execute a plug-in unless the administrator
1050        has configured the job agent to do so. There are two things that
1051        must be done:
1052      </para>
1053     
1054      <itemizedlist>
1055        <listitem>
1056        <para>
1057          Share the job agent to the users, groups and project that should be
1058          able to use it. If the job agent is not shared, only the owner of
1059          job agent is allowed to use it. Use the regular <guilabel>Share</guilabel>
1060          functionality to specify which users/groups/projects
1061          should be able to use the job agent. You must give
1062          them at least <command>USE</command> permission.
1063          To give all users permission to the job agent share it
1064          to the <command>EVERYONE</command> group.
1065        </para>
1066        </listitem>
1067       
1068        <listitem>
1069        <para>
1070          Selecting plug-ins that the job agent should handle. This can be
1071          done either from the plug-in pages or from the job agent pages. To register
1072          a plug-in with one or more job agents from the plug-in pages, go
1073          to the edit view of the plug-in and select the <guilabel>Job
1074          agents</guilabel> tab. To do the same from the job agent pages,
1075          go to the edit view of the job agent and select
1076          the <guilabel>Plugins</guilabel> tab. The registration dialogues
1077          are very similar but only the plug-in side of registration is
1078          described here. The major difference is that it is not possible
1079          to enable/disable the internal job queue for plug-in when using
1080          the jobagent side of the registration.
1081        </para>
1082        </listitem>
1083      </itemizedlist>
1084   
1085      <figure id="plugins.figures.jobagents">
1086        <title>Select job agents for a plug-in</title>
1087        <screenshot>
1088          <mediaobject>
1089            <imageobject><imagedata 
1090              scalefit="1" width="100%"
1091              fileref="figures/plugin_jobagents.png" format="PNG"
1092              /></imageobject>
1093          </mediaobject>
1094        </screenshot>
1095      </figure>
1096   
1097      <helptext external_id="plugindefinition.jobagents" 
1098        title="Job agents">
1099       
1100        <para>
1101          Use this tab to specify which job agents the plug-in is
1102          installed and allowed to be executed on.
1103        </para>
1104       
1105        <variablelist>
1106        <varlistentry>
1107          <term><guilabel>Run this plugin on</guilabel></term>
1108          <listitem>
1109            <para>
1110              You may select if the internal job queue should execute the
1111              plug-in or not.
1112            </para>
1113          </listitem>
1114        </varlistentry>
1115        <varlistentry>
1116          <term><guilabel>Job agents</guilabel></term>
1117          <listitem>
1118            <para>
1119              A list with the job agents where the plug-in is installed and
1120              allowed to be executed. Select a job agent in this list to display
1121              more configuration options for the plug-in.
1122            </para>
1123          </listitem>
1124        </varlistentry>
1125        <varlistentry>
1126          <term><guilabel>Add job agents</guilabel></term>
1127          <listitem>
1128            <para>
1129              Use this button to open a pop-up window for selecting
1130              job agents.
1131            </para>
1132          </listitem>
1133        </varlistentry>
1134        <varlistentry>
1135          <term><guilabel>Remove</guilabel></term>
1136          <listitem>
1137            <para>
1138              Remove the selected plug-in from the list.
1139            </para>
1140          </listitem>
1141        </varlistentry>
1142        </variablelist>
1143       
1144        <para>
1145          The following properties are only displayed when a
1146          job agent has been selected in the list. Each job agent may have it's
1147          own settings of these properties. If you leave the values unspecified
1148          the job agent will use the default values specified on the
1149          <guilabel>Plugin</guilabel> tab.
1150        </para>
1151       
1152        <variablelist>
1153        <varlistentry>
1154          <term><guilabel>Max memory</guilabel></term>
1155          <listitem>
1156            <para>
1157              The maximum amount of memory the plug-in is allowed to use.
1158              Add around 40MB for the Java run-time environment and BASE.
1159              If not specified Java will choose it's default value which is 64MB.
1160            </para>
1161          </listitem>
1162        </varlistentry>
1163        <varlistentry>
1164          <term><guilabel>Trusted</guilabel></term>
1165          <listitem>
1166            <para>
1167              If the plug-in should be executed in a protected or
1168              unprotected environment. Currently, BASE only supports
1169              running plug-ins in an unprotected environment.
1170            </para>
1171          </listitem>
1172        </varlistentry>
1173        <varlistentry>
1174          <term><guilabel>Priority boost</guilabel></term>
1175          <listitem>
1176            <para>
1177              Used to give a plug-in higher priority in the job queue.
1178              Values between 0 and 10 are allowed. A higher value will
1179              give the plug-in higher priority. The priority boost is useful
1180              if we, for example, want to use one server mainly for importing
1181              data. By giving all import plugins a priority boost they will
1182              be executed before all other jobs, which will have to wait
1183              until there are no more waiting imports.
1184            </para>
1185          </listitem>
1186        </varlistentry>
1187        </variablelist>
1188       
1189        <seeother>
1190          <other external_id="plugindefinition.edit">Plug-in properties</other>
1191          <other external_id="plugindefinition.edit.permissions">Plug-in permissions</other>
1192        </seeother>
1193      </helptext>
1194    </sect2>
1195
1196  </sect1>      <!-- job agent setup -->
1197
1198  <sect1 id="installation.serverconfigurations">
1199    <title>Server configurations</title>
1200    <para>
1201      Some server configurations can be done when the installation process is finished and
1202      BASE is up and running. Log into BASE with administration rights and then
1203      open the configuration dialog from menu
1204      <menuchoice>
1205        <guimenu>Administrate</guimenu>
1206        <guimenuitem>Server settings</guimenuitem>
1207      </menuchoice>.
1208      Each tab in the configuration dialog-window is described below.
1209    </para>
1210   
1211      <figure id="installation.figures.serverconfiguration">
1212        <title>Server configuration</title>
1213        <screenshot>
1214          <mediaobject>
1215            <imageobject><imagedata 
1216              fileref="figures/server_configuration.png" format="PNG"
1217              /></imageobject>
1218          </mediaobject>
1219        </screenshot>
1220      </figure>
1221     
1222    <variablelist>
1223      <varlistentry>
1224        <term>
1225          <guilabel>File transfer</guilabel>
1226        </term>
1227        <listitem>
1228          <helptext external_id="serverconfig.filetransfer" title="File transfer rate">
1229            <variablelist>
1230              <varlistentry>
1231                <term><guilabel>Max upload rate</guilabel></term>
1232                <listitem>
1233                  <para>
1234                    This is a limit of how many bytes of data that should be
1235                    transferred per second when uploading files to BASE. Prefixes
1236                    like k, M or G can be used for larger values, just like
1237                    described in the tab. The limit is per ongoing upload
1238                    and the default value is 100MB/s.
1239                  </para>
1240                </listitem>
1241              </varlistentry>
1242              <varlistentry>
1243                <term><guilabel>Max download rate</guilabel></term>
1244                <listitem>
1245                  <para>
1246                    This is a limit of how many bytes of data that should be
1247                    transferred per second when downloading files from BASE. Prefixes
1248                    like k, M or G can be used for larger values. The limit is per ongoing
1249                    download and the default value is unlimited.
1250                  </para>
1251                </listitem>
1252              </varlistentry>
1253              <varlistentry>
1254                <term><guilabel>Unlimited</guilabel></term>
1255                <listitem>
1256                  <para>
1257                    Check one or both to not limit the upload/download transfer rate.
1258                    In this case, the Internet connection of the server is the limit.
1259                  </para>
1260                </listitem>
1261              </varlistentry>
1262            </variablelist>
1263          </helptext>
1264        </listitem>
1265      </varlistentry>
1266      <varlistentry>
1267        <term>
1268          <guilabel>About</guilabel>
1269        </term>
1270        <listitem>
1271          <helptext external_id="serverconfig.about"
1272            title="Information about the server">
1273            <variablelist>
1274              <varlistentry>
1275                <term><guilabel>Administrator name</guilabel></term>
1276                <listitem>
1277                  <para>
1278                    Name of the responsible administrator. The name is displayed
1279                    at the bottom of each page in BASE and in the about-dialog.
1280                  </para>
1281                </listitem>
1282              </varlistentry>
1283              <varlistentry>
1284                <term><guilabel>Administrator email</guilabel></term>
1285                <listitem>
1286                  <para>
1287                    An email which the administrator can be contacted on. The
1288                    administrator name, visible at the bottom of each page, will
1289                    be linked to this email address.
1290                  </para>
1291                </listitem>
1292              </varlistentry>
1293              <varlistentry>
1294                <term><guilabel>About</guilabel></term>
1295                <listitem>
1296                  <para>
1297                    Text written in this field is displayed in the
1298                    <guilabel>About this server</guilabel> section on the login
1299                    page and in the about-dialog window. We recommend changing the
1300                    default Latin text to something meaningful, or remove it
1301                    to hide the section completely.
1302                  </para>
1303                </listitem>
1304              </varlistentry>
1305            </variablelist>
1306          </helptext>
1307        </listitem>
1308      </varlistentry>
1309      <varlistentry>
1310        <term>
1311          <guilabel>Get account</guilabel>
1312        </term>
1313        <listitem>
1314          <helptext external_id="serverconfig.getaccount"
1315            title="Instructions to get an account">
1316            <para>
1317              A description what a user should do to get
1318              an account on the particular BASE server. This text is linked
1319              to the <guilabel>Get an account!</guilabel> link on the login
1320              page. We recommend that the Latin text is replaced with some useful
1321              information, or that it is removed to hide the link.
1322            </para>
1323          </helptext>
1324        </listitem>
1325      </varlistentry>
1326      <varlistentry>
1327        <term>
1328          <guilabel>Forgotten password</guilabel>
1329        </term>
1330        <listitem>
1331          <helptext external_id="serverconfig.password"
1332            title="Instructions when password is forgotten.">
1333            <para>
1334              A description what a user should do if the password is forgotten.
1335              This text is linked
1336              to the <guilabel>Forgot your password?</guilabel> link on the login
1337              page. We recommend that the Latin text is replaced with some useful
1338              information, or that it is removed to hide the link.
1339            </para>
1340          </helptext>
1341        </listitem>
1342      </varlistentry>
1343      <varlistentry>
1344        <term>
1345          <guilabel>Links</guilabel>
1346        </term>
1347        <listitem>
1348          <helptext external_id="serverconfig.links" title="Configurable links">
1349            <para>
1350              External configurable link-types inside BASE.
1351              <note>
1352                <para>
1353                  Only link-types that have been set will be visible in the web
1354                  client.
1355                </para>
1356              </note>
1357            </para>
1358            <variablelist>
1359              <varlistentry>
1360                <term><guilabel>Help</guilabel></term>
1361                <listitem>
1362                  <para>
1363                    Links to where the help text is located. By default
1364                    this is set to the documentation for the latest released
1365                    BASE version on the BASE web site,
1366                    <ulink
1367                      url="http://base.thep.lu.se/chrome/site/doc/html/index.html">
1368                      http://base.thep.lu.se/chrome/site/doc/html/index.html</ulink>.
1369                   
1370                    If you want the documentation for a specific version you will
1371                    have to setup a site for that yourself and then change the link
1372                    to that site. The documentation is included in the downloaded package
1373                    in the directory <filename>&lt;basedir&gt;/doc/html</filename>.
1374                  </para>
1375                </listitem>
1376              </varlistentry>
1377              <varlistentry>
1378                <term>
1379                  <guilabel>FAQ</guilabel>
1380                </term>
1381                <listitem>
1382                  <para>Where frequently asked questions can be found. Empty by default.</para>
1383                </listitem>
1384              </varlistentry>
1385              <varlistentry>
1386                <term>
1387                  <guilabel>Report a bug</guilabel>
1388                </term>
1389                <listitem>
1390                  <para>
1391                    Where the user could report bugs, feature request or
1392                    perhaps other feedback that concerns the program. As default
1393                    this is set to the feedback section on BASE web site,
1394                    <ulink url="http://base.thep.lu.se/#Feedback">http://base.thep.lu.se/#Feedback</ulink>.
1395                    Note that users must login in order to submit information.
1396                  </para>
1397                </listitem>
1398              </varlistentry>
1399            </variablelist>
1400          </helptext>
1401        </listitem>
1402      </varlistentry>
1403    </variablelist>
1404   
1405    <sect2 id="installation.broadcast">
1406      <title>Sending a broadcast message to logged in users</title>
1407
1408      <para>
1409        It is possible to send a message to all logged in user.
1410        Open the
1411        <menuchoice>
1412          <guimenu>Administrate</guimenu>
1413          <guimenuitem>Broadcast message</guimenuitem>
1414        </menuchoice> dialog box.
1415      </para>
1416     
1417      <figure id="installation.figures.broadcast">
1418        <title>Broadcast message</title>
1419        <screenshot>
1420          <mediaobject>
1421            <imageobject><imagedata 
1422              fileref="figures/broadcast_message.png" format="PNG"
1423              /></imageobject>
1424          </mediaobject>
1425        </screenshot>
1426      </figure>
1427     
1428      <helptext external_id="broadcast.message" title="Broadcast message">
1429        <para>
1430        This dialog allows you to specify a message that is sent to all
1431        logged in users as well as on the login form. It is also possible
1432        to "disable" login.
1433        </para>
1434        <variablelist>
1435        <varlistentry>
1436          <term><guilabel>Title</guilabel></term>
1437          <listitem>
1438            <para>
1439            The title of the message. It should be a short and concise to
1440            avoid confusion. The title will be displayed on a lot of places
1441            and a user may have to click on it to read the more detailed
1442            message.
1443            </para>
1444          </listitem>
1445        </varlistentry>
1446        <varlistentry>
1447          <term><guilabel>Disable login</guilabel></term>
1448          <listitem>
1449            <para>
1450            Mark this check-box to try to prevent new users from logging in. To
1451            avoid problems that can be caused by blocking the server admin out,
1452            the login is not completely disabled. Any user can still login but
1453            only after by-passing several warnings.
1454            </para>
1455          </listitem>
1456        </varlistentry>
1457        <varlistentry>
1458          <term><guilabel>Message</guilabel></term>
1459          <listitem>
1460            <para>
1461            If needed, a longer message giving more information. Users may
1462            have to click on a link to be able to see the complete message.
1463            </para>
1464          </listitem>
1465        </varlistentry>
1466        </variablelist>
1467       
1468        <note>
1469          The message will be enabled until it is manually removed by saving
1470          an empty form, or until the Tomcat server is restarted. Since the
1471          message is only kept in memory, a restart will always remove it.
1472        </note>
1473     
1474      </helptext>
1475     
1476    </sect2>
1477   
1478  </sect1>
1479
1480  <sect1 id="installation.migrate">
1481    <title>Migrating from MySQL to PostgreSQL</title>
1482   
1483    <para>
1484      It is possible to migrate a BASE installation on a MySQL database to a
1485      PostgreSQL database. In a real-world scenario a migration is probably coupled
1486      with a hardware upgrade, i.e. the MySQL installation is on one (the old) server
1487      and the PostgreSQL installation is on another (the new) server. While
1488      this is not any problem per se, it requires a few extra steps to ensure that
1489      everything has been moved to the new server. There are three main steps involved:
1490    </para>
1491   
1492    <variablelist>
1493      <varlistentry>
1494        <term>Export</term>
1495        <listitem>
1496          <para>
1497          The first step is to export all data in the existing database. Use
1498          the following procedure:
1499          </para>
1500         
1501          <orderedlist>
1502            <listitem>
1503              <para>
1504              Upgrade to the latest BASE release. This is recommended since
1505              it probably has fewer bugs.
1506              </para>
1507            </listitem>
1508
1509            <listitem>
1510              <para>
1511              Make sure that no other processes are writing to the database
1512              when the export is running. Shut down Tomcat and all job agents.
1513              It may also be a good idea to ensure that no backup scripts or
1514              other external programs are reading from the database at the same
1515              time. If the database is large, this may affect performance due to
1516              increased disk I/O.
1517              </para>
1518            </listitem>
1519           
1520            <listitem>
1521              <para>
1522              Create a temporary working directory in a suitable
1523              location. This directory will be used for storing the
1524              exported data. Disk I/O performance may be better if
1525              this directory is on a different disk than what the
1526              database is using. Ensure that the location has enough
1527              free space to hold all data from the BASE database. The dump
1528              typically uses less than 10% of the disk space used by the
1529              MySQL tables.
1530              </para>
1531            </listitem>
1532
1533            <listitem>
1534              <para>
1535              Make sure that you have configured migration-specific settings
1536              in the <filename>base.config</filename> file. In most cases the
1537              default settings should be good, but if you are experiencing
1538              performance problems it may be necessary to change some settings.
1539              See <xref linkend="appendix.base.config.migrate" /> for more
1540              information.
1541              </para>
1542            </listitem>
1543
1544            <listitem>           
1545              <para>
1546                Start the export by changing to the <filename
1547                class="directory">&lt;base-dir&gt;/bin/</filename>
1548                directory and execute:
1549              </para>
1550<programlisting>
1551./migrate.sh export <replaceable>/path/to/migration/dir</replaceable>
1552</programlisting>
1553              <para>
1554                where <replaceable>/path/to/migration/dir</replaceable>
1555                is replaced with the path to the working directory created above.
1556                Depending on the size of the BASE installation the export may
1557                take a long time.
1558              </para>
1559            </listitem>
1560          </orderedlist>
1561         
1562          <note>
1563            <para>
1564              Make sure that the migration working directory is empty to perform
1565              a full export. Existing files in the directory causes the corresponding
1566              tables to be skipped. This can be useful when debugging and after a
1567              server crash, since the export will resume where it stopped. Just make
1568              sure that the database hasn't been modified in the meantime.
1569            </para>
1570          </note>
1571          <warning>
1572            <para>
1573            When exporting, make sure that no other process is updating the
1574            database since that may create an inconsistent snapshot. The
1575            export process does not lock the database or take any other means
1576            to protect it against concurrent modifications.
1577            </para>
1578          </warning>
1579        </listitem>
1580      </varlistentry>
1581     
1582      <varlistentry>
1583        <term>Moving data</term>
1584        <listitem>
1585          <para>
1586          This step is about moving the data from the old BASE server to the
1587          new BASE server. If the migration is taking place on a single server,
1588          this step can probably be skipped.
1589          </para>
1590         
1591          <orderedlist>
1592            <listitem>
1593              <para>
1594              Download and unpack the BASE software on the new server. Make sure that you are
1595              using the same version as on the old server. It is also important that
1596              the database is identically configured. Pay special attention
1597              to the <filename>extended-properties.xml</filename> and
1598              <filename>raw-data-types.xml</filename> files and any files
1599              in the <filename
1600              class="directory">&lt;base-dir&gt;/WEB-INF/classes/extended-properties</filename>
1601              and <filename
1602              class="directory">&lt;base-dir&gt;/WEB-INF/classes/raw-data-types</filename>
1603              directories.
1604              The import program protects against some mistakes by comparing
1605              the column names from the export with the column names in the new
1606              database, but it will, for example, not check that data types match.
1607              </para>
1608             
1609              <tip>
1610                The easiest way to do this is to simply copy the BASE installation
1611                from the old server to the new server. Then, go through the
1612                configuration files and make sure that paths are correct.
1613              </tip>
1614             
1615            </listitem>
1616         
1617            <listitem>
1618              <para>
1619              Move user files from the old server to the new server. Make sure that
1620              the <property>userfiles</property> setting in <filename>base.config</filename>
1621              is correct.
1622              </para>
1623            </listitem>
1624           
1625            <listitem>
1626              <para>
1627              Move plug-ins from the old server to the new server. Make sure that
1628              the <property>plugins.dir</property> setting in <filename>base.config</filename>
1629              is correct.
1630              </para>
1631            </listitem>
1632
1633            <listitem>
1634              <para>
1635              Check other settings in <filename>base.config</filename> and
1636              other configuration files for settings that may be affected by
1637              the move.
1638              </para>
1639            </listitem>
1640         
1641          </orderedlist>
1642         
1643        </listitem>
1644      </varlistentry>
1645     
1646      <varlistentry>
1647        <term>Import</term>
1648        <listitem>
1649          <para>
1650            When everything has been moved and is properly configured it is
1651            time to start with the import.
1652          </para>
1653         
1654          <orderedlist>
1655            <listitem>
1656              <para>
1657              Create a new empty database following the
1658              instructions in <xref linkend="installation.main.database" />.
1659              Make the corresponding changes in <filename>base.config</filename>
1660              so that the BASE installation points to the new database.
1661              Also, make sure that you have configured migration-specific settings
1662              in the <filename>base.config</filename> file. In most cases the
1663              default settings should be good, but if you are experiencing
1664              performance problems it may be necessary to change some settings.
1665              See <xref linkend="appendix.base.config.migrate" /> for more
1666              information.
1667              </para>
1668            </listitem>
1669         
1670            <listitem>
1671              <para>
1672              Read the
1673              <ulink url="http://www.postgresql.org/docs/9.1/interactive/populate.html">http://www.postgresql.org/docs/9.1/interactive/populate.html</ulink>
1674              document from the PostgreSQL documentation and consider implementing some
1675              of the tips. The migration script makes sure that no indexes or foreign
1676              key constraints are active during the data import, but the tips about memory,
1677              checkpoint intervals, WAL archiving, etc. (section 14.4.5 and on) can be useful.
1678              It may also be a good idea to turn off the auto-vacuum daemon during the import.
1679              </para>
1680            </listitem>
1681           
1682            <listitem>
1683              <para>
1684                Start the import by changing to the <filename
1685                class="directory">&lt;base-dir&gt;/bin/</filename>
1686                directory and execute:
1687              </para>
1688<programlisting>
1689./migrate.sh import <replaceable>/path/to/migration/dir</replaceable>
1690</programlisting>
1691              <para>
1692                where <replaceable>/path/to/migration/dir</replaceable>
1693                is replaced with the path to the directory where
1694                the exported data is stored. Depending on
1695                the size of the BASE installation this may take a long time.
1696              </para>
1697             
1698              <note>
1699                <title>Installations with separate web and database servers</title>
1700                <para>
1701                Both export and import may be executed against remote MySQL/PostgreSQL
1702                servers without limitation. The migration working directory need only
1703                to be accessible by the BASE migration program.
1704                </para>
1705              </note>
1706             
1707            </listitem>
1708           
1709            <listitem>
1710              <para>
1711              Restart Tomcat and verify that the migration was successful. Eg.
1712              check that you can log in to BASE, that you can access files,
1713              that plug-ins are working, etc. Then, shut everything down again.
1714              </para>
1715            </listitem>
1716
1717            <listitem>
1718              <para>
1719              Setup backup procedures for the new server. Verify that the
1720              backup is working before starting up Tomcat again.         
1721              Restart any job agents (make sure that the are configured to use
1722              the new server). When everything is up and running again, the
1723              <replaceable>/path/to/migration/dir</replaceable> directory
1724              and all files can be deleted.
1725              </para>
1726            </listitem>
1727          </orderedlist>
1728       
1729        </listitem>
1730      </varlistentry>
1731    </variablelist>
1732   
1733  </sect1>
1734
1735</chapter>
Note: See TracBrowser for help on using the repository browser.