Migration of hMail 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
bajlek
Normal user
Normal user
Posts: 47
Joined: 2017-05-02 20:54

Migration of hMail server

Post by bajlek » 2020-04-05 14:03

Hi guys I just migrate (backup and restore all setting without emails). I copy emails from source to destination without any problem, but data directory have 150GB :-) so it took some time

For the first time, I backup MSSQL and restore it on new server, than backup and restore with hmail utility/script, edit path to certs and last I copied data direcotry
- Data directory was on source at D:\MSSQL\emails and destination was C:\Program Files\hMailServer\Data
This is not working - everything is fine but I dont see any folders in account settings in domain in hMail Administrator.
So I create same drive and path as was at source server and move all folders/files from "Data" directory.
I edited hMailserver.ini (first was data folder C:\Program Files\hMailServer\Data and now as from source is D:\MSSQL\emails)


But still I dont see any folders/emails. I check user rights and add domain users for all emaily but it didnt help.
I restarted services and mssql server.

Can you tell me what am I doing wrong?
I made backup on source server also setting and emails and this data folder I coppied to the server

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

Re: Migration of hMail server

Post by mattg » 2020-04-05 14:31

When you restore using the built in utility you overwrite what was there

Copy data directory, and MYSQL export (dump) and eventhandlers.vbs and perhaps hmailserver.ini Depends on passwords etc

but then DON'T do a restore or you will delete all that you have done

The settings are in the database
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

bajlek
Normal user
Normal user
Posts: 47
Joined: 2017-05-02 20:54

Re: Migration of hMail server

Post by bajlek » 2020-04-05 15:41

If I make backup of DB with SSMS (Management Studio) on old server and restore DB on new server. Passwords will rmain the same and also path for DATA directory...I still dont see those emails and because of that I cannot even connect by IMAP.

So now I uninstall hMailServer and install it again, in wizard choose to conenct to the DB. In Administration delete domain (I have only one), restart hMailServer service and now try to use "restore" only domain and messages - not settings. Hope it help...

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

Re: Migration of hMail server

Post by mattg » 2020-04-06 08:31

mattg wrote:
2020-04-05 14:31
When you restore using the built in utility you overwrite what was there
EVERYTHING that was there - not just the bits you choose
bajlek wrote:
2020-04-05 15:41
If I make backup of DB with SSMS (Management Studio) on old server and restore DB on new server. Passwords will rmain the same and also path for DATA directory...I still dont see those emails and because of that I cannot even connect by IMAP.
there is at least three things in that

Connections to IMAP is one
Did you copy the data directory? messages aren't in the database
You also need database connection passwords to be the same, data directories to be the same, hmailserver versions to be the same, databases to be named the same
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

bajlek
Normal user
Normal user
Posts: 47
Joined: 2017-05-02 20:54

Re: Migration of hMail server

Post by bajlek » 2020-04-15 11:53

Śo, I use backup utility in hmailserver administration and make backup of settings and emails. BUT data directory have 150GB which I backup almost 12 hours and restore is now running few days :-D and still no end (information from backup log). So I archive all my emails on client side and now I have 8GB of emails :-D

I will try this again backup with messages on old server, then on new server delete database and make new one, connect new one to the fresh install of hmailserver to run fresh restore and I will give you feedback.

Old server data directory is D:\blahblah\emails
New server data directory can be the same or in hmailserver built-in data directory in Program Files

So, should I backup database on MSSQL if I run backup / restore from hmailserver (I think no-because this data will be written to new fresh clean databse) right?
Should I prepare path on new server or restore utility will read config file and copy messages here?

John

bajlek
Normal user
Normal user
Posts: 47
Joined: 2017-05-02 20:54

Re: Migration of hMail server

Post by bajlek » 2020-04-15 22:14

Guys! Doooone :-) Thank you for all hints from you. Because I reduce emails from 150GB to 15GB (archive is great function) I can make backup within minutes (with messages) and restore was also very quick. I change DNS records and everything is working like a charm :-) I install ubuntu server for roundcube nad IIS at new server for PHPWebAdmin and now my new struggle will be using hms_plugins from tunis78 (https://github.com/tunis78) in this Ubuntu virtual connected to HmailServer. I also set up ESET Secure Office (ecls cmd line scanner) to scan emails and it is working without any problem (solution found on this forum).

Thank you again for support!

John

User avatar
SorenR
Senior user
Senior user
Posts: 3623
Joined: 2006-08-21 15:38
Location: Denmark

Re: Migration of hMail server

Post by SorenR » 2020-04-16 11:36

bajlek wrote:
2020-04-15 22:14
Guys! Doooone :-) Thank you for all hints from you. Because I reduce emails from 150GB to 15GB (archive is great function) I can make backup within minutes (with messages) and restore was also very quick. I change DNS records and everything is working like a charm :-) I install ubuntu server for roundcube nad IIS at new server for PHPWebAdmin and now my new struggle will be using hms_plugins from tunis78 (https://github.com/tunis78) in this Ubuntu virtual connected to HmailServer. I also set up ESET Secure Office (ecls cmd line scanner) to scan emails and it is working without any problem (solution found on this forum).

Thank you again for support!

John
SUPER easy. Create a subfolder on IIS and dump Tunis's code in there. Rest is simple configuration.
There is one missing from GitHub... Password !!
Attachments
Tunis-password.rar
(2.46 KiB) Downloaded 39 times
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

Post Reply