Changing a domain name

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
LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

Changing a domain name

Post by LesD » 2016-01-25 20:27

Hunted for the bug reporting page but could not find it, so posting to here:

Running 5.6.3 B2249

I had a complex domain (many accounts/aliases/etc) that had been transferred out to be hosted elsewhere and I did not want to delete it yet from hMS.

So I just suspended it. But that stopped me from emailing anyone at that domain - Thunderbird reported a 550 error - domain is suspended.

So I decided to change the the domain name in hMS. Clicking on Save made hMS Administrator hang (unresponsive). Eventually I killed it and reopened it again.

It still showed the domain with the old name so I changed it again but this time to a slightly different name. Same result.

I then discovered that two new folders had appeared in the hMS Data folder named as per the new names I had given the old domain.

Both folders were gradually growing in size. The original folder stayed the same size (some 5GB). Eventually the growing stopped, the folder with the original domain name disappeared and I was left with the two new folders, each the full size of the original.

On the domain accounts side, some accounts had been renamed per the first rename and some per the second.

The aliases and distribution lists were all renamed per the first name.

I do not need to repair this as I intend anyway to delete the domain(s) shortly - I just wanted a copy for a bit longer.

hMS is obviously designed to cope with domain renaming. It just may need some locking mechanism to ensure that the above cannot happen.

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

Re: Changing a domain name

Post by jimimaseye » 2016-01-25 20:34

When you change the domain name hms set about creating the new data directory and copy/migrating all emails contained within it. This is why you had the delay. It needs time to complete (and obviously disk space) and this all depends on the size of the data you are changing from. Unfortunately it doesnt just do a 'rename' of the folder at disk level. Also, of course, it has to rebuild the database tables to match the data it is to contain. Once completed the original data folder would have been deleted.

It was the interuption that caused the problem (some with new name, some with old etc) and the inconsistencies.
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

LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

Re: Changing a domain name

Post by LesD » 2016-01-25 22:06

Explanation accepted. My post was just to suggest some possible improvements to this process. If it can happen then it will! It did.

An unresponsive screen without any 'busy' message is asking to be killed off.

The updating is obviously being done by the service as evidenced by the fact that the first change continued even after the Admin screen was killed off. So I would have thought there was really no need for the screen to lock up.

I would also suggest that such a potentially long running process needs to be safely locked during the process. What if an email arrives for the old/new domain during the conversion? Maybe even a rename should be restricted to when the server is off-line - unless the data folder for it is empty.

Just some thoughts on preventing what could be a disaster for someone.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Changing a domain name

Post by percepts » 2016-01-25 22:37

the best place to post suggestions/bugs is at

https://github.com/hmailserver/hmailserver

under the issues tab

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

Re: Changing a domain name

Post by jimimaseye » 2016-01-25 23:02

LesD wrote:Explanation accepted. My post was just to suggest some possible improvements to this process. If it can happen then it will! It did.

An unresponsive screen without any 'busy' message is asking to be killed off.

The updating is obviously being done by the service as evidenced by the fact that the first change continued even after the Admin screen was killed off. So I would have thought there was really no need for the screen to lock up.

I would also suggest that such a potentially long running process needs to be safely locked during the process. What if an email arrives for the old/new domain during the conversion? Maybe even a rename should be restricted to when the server is off-line - unless the data folder for it is empty.

Just some thoughts on preventing what could be a disaster for someone.
Yeah, I think so too. I agree.

We have discussed this name changing before on the forum and how incredibly long it takes. Im sure it could be done in a more efficient way especially considering that everything is under a windows folder (for data) and the database is SQL. (eg, lock the domain/service, rename the folder, and do a SQL to update the reference of domain names in the database). I personally cant see why it should take so long by copying the .EML files one by one and importing them as new.
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

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

Re: Changing a domain name

Post by mattg » 2016-01-26 01:39

I've not tried

But I wonder if after making the domain inactive, that if you then set up a route for the same domain, what would have happened??
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

Re: Changing a domain name

Post by LesD » 2016-01-26 07:28

I tried that for the renamed domain.

Set a route via an external server but still got the same message.

Re-Enabled the domain and the message went out via the remote host.

Post Reply