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

Last change on this file since 6479 was 6479, checked in by Nicklas Nordborg, 7 years ago

References #1742: Upgrade to Hibernate 4.x

Documented change in PostgreSQL dialect.

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