Upgrading your NaSMail installation
===================================

If you are upgrading from a previous version of NaSMail, you can use this guide
to make the transition a bit smoother.


0. Check requirements
=====================

The system requirements may have been changed between your previous version and
this version of NaSMail. The requirements won't change (much) between stable 
releases but may change significantly between different series (e.g. between 
1.0.x and 1.2.x). Most notably, you need at least PHP version 4.1.0. The 
ReleaseNotes file is a good source for information about changed requirements.


1.  Backup old install
======================

Make a backup of your current NaSMail directory.  If you use "cp", be sure to 
use the "-Rp" options.  -R means recursive, and -p will save the permissions in
the directory.

In this example, we assume that your httpd document directory is 
/home/httpd/html, that your NaSMail install is located at 
/home/httpd/html/nasmail-1.0, and that your new NaSMail version is 1.1. 
Substitute version numbers and names as required.

  $ cd /home/httpd/html
  $ cp -Rp nasmail-1.0 nasmail-1.0.bak


2.  Unarchive new NaSMail
==============================
Make sure that you are in your httpd document directory (/home/httpd/html)
and then unarchive the NaSMail archive (whatever the filename is):

  $ tar -zxvf nasmail-1.1.0.tar.gz


3.  Copy important files from old install
=========================================
The important files to copy are:
  A.  Preferences
  B.  Config details
  C.  Plugins
  D.  Themes (if you've edited or added any of them)

A.  Preferences

First, copy your preference data over to the new directory.

  $ cp nasmail-1.0.bak/data/* nasmail-1.1/data

B.  Config details

If at all possible, start the configuration process from scratch.  It is much 
less prone to missing configuration options than copying your old 
configuration.  Ideally, you should just run conf.pl to reconfigure NaSMail. 
If you decide to copy your old config.php over, we strongly recommend that you
run conf.pl to make sure things are correct and then save the config file.

  $ cp nasmail-1.0.bak/config/config.php nasmail-1.1/config

C.  Copy plugins

Like NaSMail, plugins are frequently updated for improvements, as well as to 
make them compatible with new NaSMail releases.  It is suggested that you 
download new versions of your plugins at the same time you download your 
NaSMail install, and that you install your plugins fresh (it's easy, don't 
panic!).

You should not try replacing plugins that are already included in NaSMail 
package. Download latest versions of plugins that are not included in new 
NaSMail package or copy them from older NaSMail install.

D.  Copy themes

If you've created or modified themes, you should copy just those to the new
NaSMail themes directory.  To just copy them all over to the new
NaSMail installation, you can run one command.

  $ cp -Rui nasmail-1.0.bak/themes/* nasmail-1.1/themes/

When -u flag is used, command copies only missing and newer files.
When -i flag is used, command asks for confirmation before replacing
existing files.


4.  Change permissions
======================
The web server must have write permission to the data directory.  In this
example, we assume that user "nobody" and group "nobody" are the web server
as is often the case with Apache.

  $ cd nasmail-1.1
  $ chown -R nobody:nobody data

See INSTALL for alternate userid/groupid pairs.  Additionally, if "chown
user:group" doesn't work, you can use "chown user" and "chgrp group" instead.
See the man pages for these commands for more information.


5.  Run conf.pl
===============
Run config/conf.pl to see the new configuration options available with the new
version, as well as to verify that all of your old options are set properly.

Always save your options, also if you haven't changed anything. This will 
ensure that any problems with conf.pl that might have been solved are effective
to your installation.


6.  DONE!
=========
That should be all!  The most important part is copying your users' preference 
files back into the new data directory.  This will insure that your users will 
have their old preferences.


7.  UPGRADING FROM SQUIRRELMAIL
===============================
If you replace your SquirrelMail install with NaSMail, you should update your
configuration file and reapply IMAP server's preset. NaSMail configuration file
is not compatible with SquirrelMail 1.4.x configuration. NaSMail uses different
variables and made some changes in presets. Plugins designed for SquirrelMail 
might not work correctly in NaSMail.
