Move Server ( With / Without Upgrade )
This guide is designed to help you move MailArchiva to another server. There are two aspects to consider:
- Move Server - Setting up a new MailArchiva server and copying configuration, application and audit data
- Move Volume Data - Moving volume data to a new location
Move Server
Moving servers is straight forward once you develop the understanding that each version of MailArchiva simply looks for files in specific places. Fortunately, there are no nasty migration scripts or sql dumps to run. If there are any upgrade procedures involved, these will be performed automatically on startup. Thus, in most cases, one merely needs to copy files from point A to point B (as described below).
The process of moving MailArchiva's configuration involves:
- Installing a fresh copy of MailArchiva on the new server (without completing the Wizard!) (Refer to Quick Setup)
- Stopping the new server. Stop the MailArchiva Service from Services Applet (Windows) or run /etc/init.d/mailarchiva stop (Linux)
- Copy the directories indicated further in the tables below from the old server to the same/equivalent locations on the new server. Refer to Step 3 below.
- Delete/Edit the bootstrap.conf file (if present) in the configuration path. Refer to Step 4 below.
- Updating volume index and store paths (if necessary). Refer to Step 5 below.
- Starting the new server. Start the MailArchiva Service from Services Applet (Windows) or run /etc/init.d/mailarchiva start (Linux)
If moving from V2 and upgrading to V3/V4 at the same time, some additional steps need to be taken:
- Close the existing Active volume (if applicable). In Configuration->Volumes click Close on the Active volume.
- Create a new volume (so that data will be written in a new format). In Configuration->Volumes click New Volume. Enter new store and index paths. Save.
- Check your client connections and listeners to ensure they are all defined correctly. Verify in Configuration->Client Connections and Configuration->Listeners.
- Reindex all volumes. Click the Reindex All button in Configuration->Volumes.
- Install a new license (contact accounts if you do not have one yet!). From Configuration->About, click the Install License button.
Step 3. Copying Files
With regards to Step 3 above, using Windows Explorer or the command line, simply perform a recursive copy of the directories below to their equivalent locations on the new server. For instance, when moving from V2 to V3, to copy the main server config, you would copy C:\Program Files\MailArchiva\server\webapps\ROOT\WEB-INF\conf\* to C:\ProgramData\MailArchiva\ROOT\conf (Windows 7-11). If the new MailArchiva server resides on a different OS, copy the directories to their counterpart locations for the target operating system.
MailArchiva v3.0 and higher
*Application Data consists of queue and database directories. Both these directories need to be copied over to the new server.
MailArchiva v2.0
Step 4. Edit/Delete Bootstrap.conf
appdata.path=/var/opt/mailarchiva/mailarchiva
view.path=%app%/temp
queue.path=%appdata%/queue
backup.path=/var/opt/mailarchiva/mailarchiva
log.path=/var/log/mailarchiva/mailarchiva
debuglog.path=%log%/debug
auditlog.path=%log%/audit
update.path=%appdata%/updates
keystore.filepath=%conf%/mailarchivacerts
themes.path=%app%/themes
database.file=%appdata%/database/archiva.db
plugins.path=%app%/plugins
log.level=info
Step 5. Updating Volume Index & Store Paths
When moving servers, if the volume store and index paths change, in Configuration->Volumes, unmount each volume individually and change the store and index paths to reflect the new location. Note: Active volumes will need to be closed before unmounting them. Alternatively, edit the main server configuration file (e.g. edit server.conf using wordpad or vi) with the new path locations. Refer to Move Volumes below for further details on how to move volume data.
Move Volumes
Using Windows Explorer or the commandline, perform a recursive copy of the contents of the volume store and index directories (listed in Configuration->Volumes ) to their corresponding target locations. MailArchiva v2.0 volumes contain a large amount of directories / files which can be difficult to handle (this is one reason why the volume store format is updated in MailArchiva v3). On Linux, when using the cp command you may receive errors such as "too many arguments". Refer to http://www.linuxjournal.com/article/6060 to correct this. On Windows, before copying data using Windows Explorer, install the freeware Teracopy program as it is particularly effective for copying large amounts of data.
On the live MailArchiva server, unmount each copied volume individually in Configuration->Volumes. When a volume is unmounted, its index and store path is editable. Enter the new volume and index store path locations, save and mount. The volume status should change to reflect the old volume status.
If the volume's status is incorrect, on the file system, edit a file called volumeinfo (located in the root of the volume's store path) using a text editor. Edit the status to CLOSED (all caps). if moving volume data to a remote NAS or SAN location, ensure that the MailArchiva Windows service is running an account with sufficient privileges to read/write to the location. Refer to Network Attached Storage for more information.
Found this information useful? Visit mailarchiva.com to learn more about MailArchiva.