# Using Advanced Archive Stores

MailStore distinguishes between two types of archive stores: Standard archive store and advanced archive store.

When using standard archive stores, folder information, meta data, email headers and contents, and the full text index are all stored within a directory structure in the file system, while advanced archive stores allow you to store these components in different locations, such as SQL databases, for example. The 500,000 emails per archive store limit also applies to advances archive stores.

For most environments, using standard archive stores is recommended, which is described in detail in chapter [Storage Locations](http://support.quikbox.com/article.php?id=290).

<div id="bkmrk-%C2%A0"> </div><div id="bkmrk-information-title"><div><div><div><span style="color: #00ccff;">**Information Title**</span></div><div></div></div></div></div><span style="color: #ffcc00;">If advanced archive stores use SQL databases to store data, the appropriate database server needs to be running before the MailStore Server service is started. Manual configuration of a service dependency may be required.</span>

# <span style="color: #0000ff;">**Structure of an Archive Store** </span>

In MailStore, both standard an advanced archive stores always consist of the following three components:

**Folder Information and Meta Data**

Contains all data needed for the construction of the directory structure and the email list, which in some cases is also used in search requests.

**Email Headers and Contents**

Contains the actual payload of the archive.

**Full Text Index**

Contains all data needed for browsing emails and attachments.

While there is a direct relationship between *folder information and meta data* and *email headers and contents*, the full text index is derived from both and can be reconstructed at any time.

Because of its special data structure and for performant access, the full text index must always be stored in the file system. Using MailStore's local file system is recommended. Additional information about full text indexes is available in chapter [Search Indexes](http://support.quikbox.com/article.php?id=294).

Please notice, that the 500,000 emails per archive store limit also applies to advances archive stores.

# <span style="color: #0000ff;">**Creating an Advanced Archive Store** </span>

To create an advanced archive store, please proceed as follows:

- Start MailStore Client and log on as MailStore administrator (admin).
- Click on *Administrative Tools &gt; Storage* and then on *Storage Locations*.
- In the menu bar at the bottom of the window click on *Create...*.
- The dialog *Create New Archive Store* opens.

Enter a name for the new advanced archive store into the *Name* field, e.g. *2012-05*.

<span style="color: #ffcc00;">If you don't want MailStore to archive new emails in the new archive store, remove the checkmark from the box titled *Archive new messages here*.</span>

- Select *Advanced Archive Store* and click on *Next*.
- Select the type of advanced archive store:

**Directory (File System)**  
The entire archive store is stored in the file system (local hard drive or network share).

**External Microsoft SQL Server Database**  
The archive store is stored in an external Microsoft SQL Server Database. Emails can be stored in the database or in the file system.

**External PostgreSQL Database**  
The archive store is stored in an external PostgreSQL Database. E-Mails can be stored in the database or in the file system.

- Click on *Next*.

Depending on the type selected, different input is required. How each archive store type is configured is described in the following sections.

## <span style="color: #000000;">**Advanced Archive Store Type: Directory (File System)** </span>

Using an advanced archive store of type *Directory (File System)* requires you to specify directories for the *Folder Information and Meta Data*, the *Email Headers and Contents* and the *Full Text Index*.

Based on the name entered at the beginning of the wizard and the path of the master database MailStore recommends directories for the new advanced archive store. To change a proposed path, click on the respective button next to the *Directory* field or enter a path manually.

<span style="color: #ffcc00;">The directories are created automatically. If they already exist, they must not contain any files of subfolders.</span>

Please note that distributing the individual components of an advanced archive store among local drives or network shares significantly increases the complexity of [Backup and Restore](http://support.quikbox.com/article.php?id=289).

## **Advanced Archive Store Type: External Microsoft SQL Server Database** 

Before you can set up the database connection in MailStore, an empty database has to be created on the database server. The MailStore user who is used for the connection should be the owner of the database. Please see the documentation of the database server for details.

*Folder information and meta data* are always stored in the SQL database, while storing *email headers and contents* therein is optional.

<span style="color: #ffcc00;">MailStore supports all editions of Microsoft SQL Server Version 2005, 2008 and 2012. Please keep their respective size limits in mind and verify their suitability for managing the expected volume of data in your environment.</span>

Once an empty database has been created, please proceed as follows:

- Specify the connection parameters for the *Microsoft SQL Server Database Connection*:

**Server Name:** Enter the server name or the IP address of the SQL server on which a database has been created for MailStore. If you click on the arrow to the right of the input field, MailStore will return a list of all Microsoft SQL servers located on the network.

**User Name:** Name of the user with access to the database.

**Password:** Password of the user listed under *User Name*.

**Database:** Name of the database to be used by MailStore. Click on the arrow to the right of the input field to obtain a list of all available databases on the server.

Under *email headers and contents* select the appropriate storage location.  
  
*Microsoft SQL Server Database* is the default suggestion. When choosing *Directory (File System)*, the input field *Directory* is activated. MailStore recommends a directory based on the name entered at the beginning of the wizard and the path of the master database. To choose a different directory, click on the button next to the *Directory* field or enter a path manually.

<div id="bkmrk-information-title-0"><div><div>**<span style="color: #00ccff;">Information Title</span>**</div><div></div></div></div><span style="color: #ffcc00;">The specified directory is created automatically. If it already exists, it must not contain any fields of subfolders.</span>

- A directory for the full text index is also recommended based on the name entered at the beginning and the path of the master database.
- Click on *Finish*.

Please note that distributing the individual components of an advanced archive store among different local drives or network shares significantly increases the complexity of [Backup and Restore](http://support.quikbox.com/article.php?id=289).

## **Advanced Archive Store Type: External PostgreSQL Database** 

Before you can set up the database connection in MailStore, an empty database has to be created on the database server. The MailStore user who is used for the connection should be the owner of the database. Please see the documentation of the database server for details.

*Folder information and meta data* are always stored in the SQL database, while storing *email headers and contents* therein is optional.

<span style="color: #ffcc00;">MailStore supports PostgreSQL version 8.4.8 or newer.</span>

Once an empty database has been created, please proceed as follows:

- Specify the connection parameters for the *PostgresSQL Database Connection*:

**Server Name:** Enter the server name or the IP address of the SQL server on which a database has been created for MailStore.

**User Name:** Name of a user with access to the database.

**Password:** Password of the user specified under *User Name*.

**Database:** Name of the database to be used by MailStore. To obtain a list of all available databases on the server, click on the arrow to the right of the input field.

Under *Email Headers and Contents* select the appropriate storage location.  
  
*PostgresSQL Database* is the default suggestion. Selecting *Directory (File System)* activates the input field *Directory*. MailStore proposes a directory based on the name entered at the beginning of the wizard and the path of the master database. To choose a different directory, click on the button next to the *Directory* field or enter a path manually.

<div id="bkmrk-information-title-1"><div><div><div><span style="color: #00ccff;">Information Title</span></div><div></div></div></div></div><span style="color: #ffcc00;">The specified directory is created automatically. If it already exists, it must not contain any files or subfolders.</span>

- MailStore also recommends a directory for the full text index based on the name entered at the beginning and the path of the master database.
- Click on *Finish*.

Please note that distributing the individual components of an advanced archive store among different local drives or network shares significantly increases the complexity of [Backup and Restore](http://support.quikbox.com/article.php?id=289).