Page 1 of 1

Migrate to New Server

Posted: 2019-12-02 10:22
by thomas10
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?

Re: Migrate to New Server

Posted: 2019-12-03 03:54
by thomas10
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

Re: Migrate to New Server

Posted: 2019-12-03 09:57
by jimimaseye
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.]

Re: Migrate to New Server

Posted: 2019-12-03 11:17
by thomas10
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:

Re: Migrate to New Server

Posted: 2019-12-03 11:49
by jimimaseye
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).

Re: Migrate to New Server

Posted: 2019-12-27 17:28
by rcauvin
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.

Re: Migrate to New Server

Posted: 2019-12-31 04:42
by thomas10
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.

Re: Migrate to New Server

Posted: 2019-12-31 13:43
by Dravion
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.

Re: Migrate to New Server

Posted: 2020-01-01 08:11
by mattg
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

Re: Migrate to New Server

Posted: 2020-01-14 16:35
by seansco
Just did basically this and the migration went flawlessly.

Re: Migrate to New Server

Posted: 2020-02-10 08:42
by thomas10
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