Page 1 of 1

Tip On Moving Installation Directories

Posted: 2008-01-06 19:50
by rfclift
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.

Posted: 2008-01-06 20:03
by martin
This will probably be changed for version 5. A known design problem which many people have had issues with..

Posted: 2008-01-06 21:07
by rfclift
Thanks for the update Martin.

Re:

Posted: 2009-02-13 18:12
by iprat
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).