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: 75
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: 75
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: 8625
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.]
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

thomas10
Normal user
Normal user
Posts: 75
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: 8625
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).
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

rcauvin
New user
New user
Posts: 15
Joined: 2017-01-02 16:39

Re: Migrate to New Server

Post by rcauvin » 2019-12-27 17:28

I performed a migration a few days ago and can confirm that the procedure @jimimaseye suggested works. As far as I can tell, those of us who use the built-in database and have a huge amount of message data have to copy the database file (hMailServer.sdf) over, since backups won't allow us to save data exceeding 15 GB. Copying the Data folder that contains all the actual messages doesn't suffice, and using the DataDirectorySynchronizer add-on to make the database recognize all the messages marks them all unread, so you lose all the history of which messages are read.

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

Re: Migrate to New Server

Post by thomas10 » 2019-12-31 04:42

rcauvin wrote:
2019-12-27 17:28
I performed a migration a few days ago and can confirm that the procedure @jimimaseye suggested works. As far as I can tell, those of us who use the built-in database and have a huge amount of message data have to copy the database file (hMailServer.sdf) over, since backups won't allow us to save data exceeding 15 GB. Copying the Data folder that contains all the actual messages doesn't suffice, and using the DataDirectorySynchronizer add-on to make the database recognize all the messages marks them all unread, so you lose all the history of which messages are read.
Hmm, that's a good news to hear. but you mentioned that "Copying the Data folder that contains all the actual messages doesn't suffice".
Does it mean that, even though I have copied the hMailServer.sdf(SQL CE database) and hmail.ini along with the all the contents in Data folder, I still need to use DataDirectorySynchronizer add-on to re-sync them back in? I hope this is not needed to do so since the mail volume is huge from my side.

User avatar
Dravion
Senior user
Senior user
Posts: 1688
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Migrate to New Server

Post by Dravion » 2019-12-31 13:43

Sonetimes there is no way arroubd it.
If possible, make sure that a exact copy of your DATA directoy is located on a fast SSD (Solid State Disk)
while indexing instead using a traditional HDD
and if finished, change it back to your normal HDD DATA folder location. This accelerates the whole operation
big time.

User avatar
mattg
Moderator
Moderator
Posts: 20885
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Migrate to New Server

Post by mattg » 2020-01-01 08:11

Normally DDS is not needed if everything is an EXACT copy

I'd simply use the built in backup to move to a new server

Backups, choosing all settings, including compression
Install SAME VERSION of hmailserver on new machine
copy backup to new machine (ie on a USB device)
Restore backup to new machine
Test, test, test
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

seansco
New user
New user
Posts: 26
Joined: 2006-07-28 20:19

Re: Migrate to New Server

Post by seansco » 2020-01-14 16:35

Just did basically this and the migration went flawlessly.

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

Re: Migrate to New Server

Post by thomas10 » 2020-02-10 08:42

Hi All,

Sorry for super late reply.
Have done the migration and yeah, just copy and paste the needed files and done.
Thanks again jimi and guys again. :D :D

Post Reply