Changing a Secondary Path Location for a Domain

SmarterMail allows system administrators to set up Secondary Storage locations for their domains. This secondary location can be used for older emails and files uploaded to SmarterMail File Storage so as to preserve disk space on more efficient, and costly, storage options. For example, primary storage can be on SSDs or high-speed arrays, which can be costly, while standard HDDs, which aren't as efficient in terms of disk i/o but can save on overall cost, can be used for older messages and files. 

While Secondary Storage locations can be initially set for a domain within the SmarterMail interface or via the API, it's not possible to actually modify that location via the interface or API once it's been initially set. In order to change the secondary storage path, the following steps need to be taken.

  1. First, you'll want to set up the new location.
  2. Next, copy the files from the current Secondary Storage location over to the location just created. You can use something like Robocopy to make this copy. (Or Hobocopy.)
  3. After that, click on the Actions (⋮) button and use Detach Domain to detach the domain. 
  4. Perform another copy and move of the files just to make sure any files that were modified get moved.
  5. Once this is done, you'll need to open the domain's settings.json file and update "secondary_storage_path"  to the new path. Be sure to save this file.
  6. Finally, you can use Attach Domain from the Actions (⋮) button to reattach the domain.
After the above steps are completed, the new Secondary Path will display for the domain and files will begin moving there the next time the daily task runs. 

NOTE: When using Docker, it's important to remember to add the new "volume" alias to your docker-compose file so that the new Secondary Path can be found.