Tip On Moving Installation Directories

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
rfclift
New user
New user
Posts: 2
Joined: 2008-01-06 19:34
Location: Vancouver, BC, Canada

Tip On Moving Installation Directories

Post by rfclift » 2008-01-06 19:50

Hi All,

I thought I would pass along a tip after many frustrating hours in trying to move my hMailServer installation from one directory to another one the same machine (using version 4.4-B270).

In my case, I wanted to move my hMailServer installation from the "Program Files" directory to the new "xampp" directory.

It was easy enough to move the program files, you simply uninstall and reinstall in the new directory (after backing up the data directory and the database of course). Note that you must uninstall and reinstall because there are extensive entries in the Windows registry that are very tedious to change manually (which I tried to do unsuccessfully).

But to make this work using an external MySQL server (and probably using the internal server), you also have to modify the hm_messages table so that the filenames for the messages point to the right place. This is because hMailServer stores a full path to each message file, rather than using relative addressing.

To do this, you need to execute the following SQL command:

SELECT ALL UPDATE hm_messages SET messagefilename=REPLACE(messagefilename,"Program Files","xampp")

I suggest making a copy of the hm_messages table and trying it there first before executing on the "live" table. Or better yet, execute the command on the copy, verify it worked correctly, rename the original table and rename the copy as hm_messages.

I hope that this is useful to someone.

Cheers!

Rob

P.S. hMailServer is a great piece of software. I had an installation run for 2 months without a problem before I had to reboot to deal with a server problem unrelated to hMailServer.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2008-01-06 20:03

This will probably be changed for version 5. A known design problem which many people have had issues with..

rfclift
New user
New user
Posts: 2
Joined: 2008-01-06 19:34
Location: Vancouver, BC, Canada

Post by rfclift » 2008-01-06 21:07

Thanks for the update Martin.

iprat
Normal user
Normal user
Posts: 247
Joined: 2005-05-20 16:50
Location: Barcelona, EU
Contact:

Re:

Post by iprat » 2009-02-13 18:12

martin wrote:This will probably be changed for version 5. A known design problem which many people have had issues with..
Hi Martin, is this true with the final 5 version ? I've had a look at http://www.hmailserver.com/documentatio ... ilserver_5 and have not been able to find any reference to this feature.

I will need to make this change but only for the data directory and I hope that in that list of tasks to do I haven't forgot any: stopping the server, moving data directory to the new place, updating hm_messages table, modify hmailserver.ini setting "DataFolder=", and restarting server.

Is that all ? (I haven't found any FAQ or HOWTO's but this one).
My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)

Post Reply