my mailserver has failed, now trouble in moving data

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
associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

my mailserver has failed, now trouble in moving data

Post by associates » 2009-11-30 05:59

Hi,

I was wondering if i can get some help from you all. My Mail Server has just failed me. The hard disk could be the issue here. So i am trying to set up a new hmailserver on another machine. Everything works fine (after running DataDirectorySynchronizer) except that i am getting all the e-mails inside the inbox folder. I mean our staff used to have a several folders related to their project number on their account. My question is how to put emails into their relevant folders.

I am using HMailServer version 5.0-B326 on XP Pro machine. I realised that there is now a new version of it. I will upgrade this later but for now, i am struggling to get this back to how it used to be.

Thank you for your help in advance

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-11-30 06:20

Data Directory Synchroniser always puts all messages into the inbox.

http://www.hmailserver.com/documentatio ... rguide_dds
The message then ends up in the users Inbox folder. The IMAP folder information is stored in the database, and since this info has been lost, hMailServer does not know what folder to store the message in.
Better way is to restore a backup - that will restore messages to correct folders...
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-11-30 06:29

Thank you Mattg for your reply.

How do i restore the backup? I have made a copy of HMailServer folder along with Apache2 and MySQL folders from the dying machine. Can i just copy and paste the data in MySQL onto the new machine?

Thank you in advance

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-11-30 07:29

If you install MySQL to the same location on the new server, then overwrite the database with the copied files, same with the hMailserver DATA folder, then what you want may happen, depending on how corrupt the copied data is.

Certainly I have previously done just that and it worked well.

The apache folder shouldn't matter. You would need to install PHP first anyway, and the webadmin components within hMailServer are easy enough to get going again. Same for you web mail... Copying Apache may not save much time over a reinstall..

Good luck
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-12-01 02:18

Thank you Mattg for your reply.

Yes, I have installed MySQL to the same location on the new server. But Please correct me if i misunderstood your instruction. I quote your saying in your previous post "then overwrite the database with the copied files, same with the hMailserver DATA folder,"

The database you are saying here - do you refer to the DATA folder in MySQL folder? because what i have done is i have done copy and paste the DATA folder (MySQL) from the old server to the new server. I have also done copy and paste with hMailServer DATA folder. After having done all these, i went to login and saw no emails (Empty) on my account. However, if i use the datadirectorysynchroniser, then i got my emails but in Inbox folder only.

I wonder if i have missed any steps here.

Thank you in advance

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-12-01 06:29

Had you installed and tested both hMailserver and MySQL on your new server and set them up the same as on your old server?

My situation was different in that I didn't have a faulty setup to start with. My move was just to a new server.

Because your move is necessitated from a failure, your entire database may have been corrupted. Copying the old to the new may just copy the corruption too.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-12-02 05:33

Hi Mattg,

Thank you for your reply.

Hooray, it works now. I can see all the emails in their relevant folders now.

However, I have another issue here. There are some additional emails that i would like to add to my account folder. What i did was i did copy and paste the emails into my account folder hoping they would show up in my inbox but they did not.

In this case, what should i do to enable the emails to show up? i do not know if i could use datadirectorysynchronizer. Last time i used it, it put all my emails into INBOX folder. I do not want that to happen again.

Thank you in advance

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-12-02 06:36

data directory synchroniser ALWAYS puts messages into the inbox.

You could use a mail client to put the messages where you want them. Where are the messages now? Where did they come from?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-12-02 07:08

Thank you Mattg for your quick reply.

This is what i have done so far.

remember that i told you that i have an issue with my old machine (used as Mail Server) that i have to shut it down to get it fixed. While i am getting it fixed, i use a different machine as the Mail Server. Let's call this different machine as a new machine for now. What are on the old machine are also in this new machine including hMailServer. This way, our staff can at least send and receive emails. I just can not afford to have the mail server down for days. When i moved all the database of MySQL and DATA of hMailServer across from my backup to the new machine. I used the datadirectorySynchroniser to synchronise all the emails. This is why i am seeing all my emails in the INBOX.

Now, my old machine has been fixed and have been re-installed with all the applications. I again use the same backup to restore all my emails back to the folders they should be under on the old machine. So now all my emails are in the right folders. This problem with having all email in INBOX has been resolved. However, the problem i am facing now is i do not know how to add all these new emails that come in between the day the old machine stop working and the day it has been fixed.

I then use robocopy to retrieve those new emails (incremental) and put them into my account folder under DATA in hMailServer. I'd expect to see them come up in my INBOX using squirrelmail but instead, i only got emails up to the day when the old machine stop working.

Hope i explained it well.

Thank you in advance

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-12-02 07:43

How big is your installation?

Number of accounts / domains, size of database etc
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-12-02 08:34

Hi Mattg,

There are around 30 accounts with total size of the database about 16G.

Thanks

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-12-02 09:01

16 Gb over 30 accounts crikey!!

You shouldn't just copy the database files, you should use a proper database backup utility to copy and restore the files.

Mine backup script is in this thread - http://www.hmailserver.com/forum/viewto ... =8&t=16325
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-12-02 13:11

Thanks Mattg.

I must admit that i was careless in dealing with the backup (after reading your thread). I will carry out a proper backup from now on.

From now on, I was planning to have two machines set up as a mail server with one being active and the other one being put aside in the event of the failure of the first machine. This way, the downtime could be minimized.

However, getting back to my issue. Are there any way of getting those latter messages shown in the INBOX? i have used robocopy to retrieve those new messages from the new machine and dump them in the account folder on the old machine. All i can see in my inbox is only those messages before it dies (old machine). I assume this has to do with the IMAP Messages in the MySQL database.

I hope there is a way to resolve this.

Thank you in advance

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: my mailserver has failed, now trouble in moving data

Post by ^DooM^ » 2009-12-02 13:16

run the data directory synchronizer

http://www.hmailserver.com/documentatio ... rguide_dds
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-12-02 14:12

Thanks DooM for your reply.

My concern is by running DDS, it would put all the messages (those that are already there and those are the latter ones) in the INBOX. I had had this problem before and am now getting nervous whenever i need to run DDS again. If you said so, i will try it tomorrow.

Thanks very much

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-12-02 14:45

DDS will only put the NEW messages in the inbox. Older messages should remain in the folders that they are in
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

associates
Normal user
Normal user
Posts: 162
Joined: 2006-01-30 04:48

Re: my mailserver has failed, now trouble in moving data

Post by associates » 2009-12-03 05:35

Thank you Mattg and ^DooM^ for your replies.

Guess what... Hooray, it works really well. After running DDS, it puts those new messages into INBOX while leaving the old ones untouched as pointed out by Mattg.

What i'll do now is to make a proper backup as advised by you. Thanks for the link, Mattg.

I will keep this whole drama and things i learnt along the way in my personal hMailServer manual for future reference.

Thank you very much

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

Re: my mailserver has failed, now trouble in moving data

Post by mattg » 2009-12-03 07:52

No worries happy to help
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply