Sometimes the initial Installation drive is exausted by space or performance or you simply wish to replace the
Datafolder to an other SSD or Hardrive. You have to options to do it:
1) Change the Data folder entry to somewhere else and update all path entries in the SQL-DB to the new data folder.
2) Use symlinks (yes Windows supports them )
The procedures:
1) Open a Administrator Command prompt
2) Stop hMailserver service by typing: net stop hMailServer
3) Create a New physical Datafolder by typing: mkdir "C:\ProgramData\hMailServerData"
4) Change folder to with "cd "C:\Program Files (x86)\hMailServer"
5) Copy or move the content oft the folder C:\Program Files (x86)\hMailServer\data\ to C:\ProgramData\hMailServerData\
6) Type in: mklink /d Data "C:\ProgramData\hMailServerData"
7) net start hMailserver
hMailServer writes all data to C:\Program Files (x86)\hMailServer\data\ but Windows secretly redirects all
read/write operations to C:\ProgramData\hMailServerData\
Thats it.
Moving hMailServer DATA folder
Re: Moving hMailServer DATA folder
Cool. Thanks for sharing!
Re: Moving hMailServer DATA folder
Thx
You welcome
You welcome
- jimimaseye
- Moderator
- Posts: 10060
- Joined: 2011-09-08 17:48
Re: Moving hMailServer DATA folder
Note that since Version 5.4 - Build 1931 the paths to the email files are not stored in the SQL database. Therefore links are not required to handle this. Hmailserver ini file just needs changing to point to the new data directory. Full details in the documentation: https://www.hmailserver.com/documentati ... _directory
1, Stop the hMailServer service
2, Move all the message files from the old to the new path
3, Open up hMailServer.ini
4, Specify the new path under the 'DataFolder=' entry
5, Restart the service
This also makes restore more robust as all paths are hardcoded and stored in the ini file and can be viewed and relied on upon on restore without missing the unmentioned/undocumented procedure of creating a link to redirect its stored destination path to another path.
1, Stop the hMailServer service
2, Move all the message files from the old to the new path
3, Open up hMailServer.ini
4, Specify the new path under the 'DataFolder=' entry
5, Restart the service
This also makes restore more robust as all paths are hardcoded and stored in the ini file and can be viewed and relied on upon on restore without missing the unmentioned/undocumented procedure of creating a link to redirect its stored destination path to another path.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Moving hMailServer DATA folder
@jimimaseye
I think it would be a very nice feature request if the default data folder is
set to c:\ProgramData\hMailServerData and/or you can choose it in the Setup because
since Vista we have this https://msdn.microsoft.com/en-us/library/cc505883.aspx
in full force on x:\Program files\ x:\Program files (x86\
I think it would be a very nice feature request if the default data folder is
set to c:\ProgramData\hMailServerData and/or you can choose it in the Setup because
since Vista we have this https://msdn.microsoft.com/en-us/library/cc505883.aspx
in full force on x:\Program files\ x:\Program files (x86\
https://technet.microsoft.com/en-us/lib ... 15936.aspxProgramData specifies the path to the program-data folder (normally C:\ProgramData). Unlike the Program Files folder, this folder can be used by applications to store data for standard users, because it does not require elevated permissions.
Re: Moving hMailServer DATA folder
https://github.com/hmailserver/hmailserver/issues/98
Martin has flagged that as a bug, and earmarked it for 5.7 release
Martin has flagged that as a bug, and earmarked it for 5.7 release
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: Moving hMailServer DATA folder
A big thank you to @Dravion for sharing the symlink trick
I do know about symlink but wasn't thinking as clear as Dravion do to get the idea myself
Especially useful if you want to place one or more mailboxes on other/new storage.
One could say it would be great if hMailserver supported storage-specification per-domain or per-mailbox instead of per-server, but symlink do the trick.
I do know about symlink but wasn't thinking as clear as Dravion do to get the idea myself
Especially useful if you want to place one or more mailboxes on other/new storage.
One could say it would be great if hMailserver supported storage-specification per-domain or per-mailbox instead of per-server, but symlink do the trick.
Re: Moving hMailServer DATA folder
I thought the paths are not saved in the database? If so, how does hmailserver know about the old path if I change it in the ini?
Re: Moving hMailServer DATA folder
It doesn't, that's the point
You can move the data directory and reset the ini setting, restarting hMailserver and all will continue to work (with the new path)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation