Moving Hmail to new machine

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
abgar
Normal user
Normal user
Posts: 93
Joined: 2005-03-23 09:33
Location: Warsaw, Poland

Moving Hmail to new machine

Post by abgar » 2017-05-24 11:10

Hello
After many years we decided to move whole Apache server to new machine.
At this occasion I decided to change structure of folders on new server to be more logic.

So what I did:
- copied hmail server mysql database to new machine - OK
- installed hmail server in new location C:\uniserver\hmailserver ( old location was: C:\server\bin\stable\hmailserver )
- connected properly hmail to new mysql, copied DATA folder, modified hmail.ini and changing values C:\server\bin\stable\hmailserver to C:\uniserver\hmailserver

Everything seemed to work OK BUT it appeared that C:\server\bin\stable\hmailserver\data was created spontaneously and there are message files appearing.

I digged deeper and found that in Mysq database hmailserver\hm_messages\messagefilename still entries of file locations remain C:\server\bin\stable\hmailserver\data. I inderstand what happens

And now my question: will it be enough if I do Mysql mass search/replace query to change C:\server\bin\stable\hmailserver\data TO C:\server\bin\stable\hmailserver\data in "messagefilename " ?
Should it work fine or there are another entries in database which can do mess ?

abgar
Normal user
Normal user
Posts: 93
Joined: 2005-03-23 09:33
Location: Warsaw, Poland

Re: Moving Hmail to new machine

Post by abgar » 2017-05-24 12:43

Sorry, I messed. This should go this way:

And now my question: will it be enough if I do Mysql mass search/replace query to change C:\server\bin\stable\hmailserver\data TO C:\uniserver\hmailserver\data in "messagefilename

prisma
Senior user
Senior user
Posts: 310
Joined: 2010-07-09 13:16

Re: Moving Hmail to new machine

Post by prisma » 2017-05-24 13:32

If you use a newer hmailserver version, you should completely remove absolute file paths instead of updating to new absolute paths. The path to messages is taken from the INI.
Search this forum, there should be examples for SQL queries.
Last edited by prisma on 2017-05-24 13:37, edited 1 time in total.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8175
Joined: 2011-09-08 17:48

Re: Moving Hmail to new machine

Post by jimimaseye » 2017-05-24 13:37

prisma wrote:If you use a newer hmailserver version, you should completely remove absolute file paths instead of updating to new absolute paths. The path to messages is taken from the INI.
Search this forum, the should be examples for SQL queries.
viewtopic.php?f=21&t=28914
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 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

abgar
Normal user
Normal user
Posts: 93
Joined: 2005-03-23 09:33
Location: Warsaw, Poland

Re: Moving Hmail to new machine

Post by abgar » 2017-05-24 13:49

jimimaseye wrote:
prisma wrote:If you use a newer hmailserver version, you should completely remove absolute file paths instead of updating to new absolute paths. The path to messages is taken from the INI.
Search this forum, the should be examples for SQL queries.
viewtopic.php?f=21&t=28914
Thank you for this hint. I am currently running 5.6.5B7

From what I read, during upgrades the database should be cleared from absolute paths but seems it has not happened.
I will dig into this.
Problem is I am not mysql guru :cry:

User avatar
jimimaseye
Moderator
Moderator
Posts: 8175
Joined: 2011-09-08 17:48

Re: Moving Hmail to new machine

Post by jimimaseye » 2017-05-24 14:18

abgar wrote: Problem is I am not mysql guru :cry:
You dont need to be. That article tells you EXACTLY how to do it in MySQL.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 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

abgar
Normal user
Normal user
Posts: 93
Joined: 2005-03-23 09:33
Location: Warsaw, Poland

Re: Moving Hmail to new machine

Post by abgar » 2017-05-24 16:53

Indeed. I managed to do it easily. :D
Thank you for help.

Post Reply