Migrate to New Server

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
thomas10
Normal user
Normal user
Posts: 57
Joined: 2013-10-30 03:13

Migrate to New Server

Post by thomas10 » 2019-12-02 10:22

Hi All,

We are going to migrate to new server due to the current one has some issues. We have referred to the documentation about Moving to a new server: https://www.hmailserver.com/documentati ... _newserver

- New Server info: Win 2008 R2 standard
- SQL Compact Edition (built-in database engine)
- Current Hmail version: hMailServer 5.6.6-B2383
- Version to install in new server: hMailServer 5.6.7 - Build 2425
- using POP,not IMAP

We are able to backup settings and domains but not the messages due to the file size is about 100GB. So we think to copy and paste it to the same directory in new server which is C:\Program Files (x86)\hMailServer.
In previous experience on migrating to new server, we used Data Directory Synchronizer to sync all the data which took hell of a long time to finish the process.

Q. Is there a way to sync the data in new server without using DDS?

thomas10
Normal user
Normal user
Posts: 57
Joined: 2013-10-30 03:13

Re: Migrate to New Server

Post by thomas10 » 2019-12-03 03:54

Added:
I have read some mentioned about using robocopy to backup the data folder.
Is the command something like below?

Code: Select all

robocopy C:\Program Files (x86)\hMailServer\Data E:\backup\Data /e

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

Re: Migrate to New Server

Post by jimimaseye » 2019-12-03 09:57

Should be ok. Perhaps use /MIR which keeps it up to data. Then copy the sql database file from the database directory and the existing hmailserver.ini file. Assuming all paths are identical (and security settings/ permissions ) on both the old and new server then you should them be able to turn the old one off (stop the service), wait some minutes for any robocopy operations to complete, then start the new service. (You will only need to handle routing and dns changes then).

Thats the theory anyway. :)

[Entered by mobile. Excuse my spelling.]
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

thomas10
Normal user
Normal user
Posts: 57
Joined: 2013-10-30 03:13

Re: Migrate to New Server

Post by thomas10 » 2019-12-03 11:17

jimimaseye wrote:
2019-12-03 09:57
Should be ok. Perhaps use /MIR which keeps it up to data. Then copy the sql database file from the database directory and the existing hmailserver.ini file. Assuming all paths are identical (and security settings/ permissions ) on both the old and new server then you should them be able to turn the old one off (stop the service), wait some minutes for any robocopy operations to complete, then start the new service. (You will only need to handle routing and dns changes then).

Thats the theory anyway. :)

[Entered by mobile. Excuse my spelling.]
Sweet response jimi, Thanks. So here're my steps to do after your explanation.
1. Install latest Hmailserver 5.6.7 in new server. Folder location same as old server location.
2. Backup setting and domains in old server and Restore setting and domain in new server.
3. Stop old server hmail service.
4. Move Data folder and hMailServer.sdf(SQL CE database) and hmail.ini to the new server (Same path as old server)
5. Once done, Restart new server hmailserver service.

Correct me if steps above wrong. :mrgreen:
Q1. This method applies too even if the both hmail versions are different?
Q2. Understand that SQL database also being moved over to the new server, does it mean that there's no need to use DDS to re-sync the data anymore? Please confirm, I am getting excited over this one because it seems to solve my worries for so many years :lol:

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

Re: Migrate to New Server

Post by jimimaseye » 2019-12-03 11:49

You wont need to do part (2) as that simply takes from the database and you will completely copying the database in (4).

Effectively the whole makeup of the service comes in 3 parts:
  • the DATA directory (containing the physical emails)
  • the database (containing configuration and location links of the emails to the data directory so that connecting email clients can read them)
  • the INI file (saying where everything sits and what the database password is)
Copy/replicate them at disk level to identical paths and permissions then you should have replicated (and no DDS required).

As for versions: if you are going from 5.6.6 to 5.6.7 then you should be ok but if you REALLY want to be sure update your old server first to 5.6.7 (it only takes 20 seconds).
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

Post Reply