Restore problem MySQL -> MS SQL

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
tonda
Normal user
Normal user
Posts: 93
Joined: 2006-10-20 14:13
Location: CZ

Restore problem MySQL -> MS SQL

Post by tonda » 2007-06-12 11:34

I try to move an existing installation of hmailserver from server where I use MySQL to newly installed server where I use MS SQL server. I tried to test backup-restore procedure and found these problems:
1. Some datetime values in backup are set to 0000-00-00 00:00:00 values. MS SQL server will not import these values, because of date range of datetime type of MSSQL server.
2. I have set up several routes and apropriate permitted e-mail addresses of routed domains. Routed domains are imported correctly, routed e-mail addresses also, but after restore all such e-mail addresses have not set up appropriate route id (checked directly in database table). So it seems there are no permitted e-mail addresses set up.

Has anybody else performed such hmailserver move (from MySQL to MSSQL)? Are there other problems I will have to face?

tonda
Normal user
Normal user
Posts: 93
Joined: 2006-10-20 14:13
Location: CZ

Post by tonda » 2007-06-12 15:07

Another problem:
3. From about 15 whitelist items there are only 2 items imported.

tonda
Normal user
Normal user
Posts: 93
Joined: 2006-10-20 14:13
Location: CZ

Post by tonda » 2007-06-12 23:27

Another problem when testing restore of all settings including messages, I have data directory moved to d:\maildata on old server and trying to restore also to d:\maildata. Folder names in error messages contain from some reason string "d:\maildata" in the middle of filename:

"APPLICATION" 1932 "2007-06-12 23:03:30.328" "Source: File::CreateDirectory(), Code: HM10028, Description: Could not create the directory D:\maildata\d:. Tried 5 times without success. Windows error code: 123 (Unknown)"
"APPLICATION" 1932 "2007-06-12 23:03:34.343" "Source: File::Copy(), Code: HM10026, Description: Could not copy the file C:\Program Files\hMailServer\Temp\RestoreTemp\DataBackup\d:\maildata\mydomain.net\user\CE\{CE902E45-FCB8-4368-86A3-DDFCF26151E2}.eml to D:\maildata\d:\maildata\mydomain.net\user\CE\{CE902E45-FCB8-4368-86A3-DDFCF26151E2}.eml. Tried 5 times without success. Windows eror code: 123 (Unknown)"

At the end of restore session I have found some messages are restored correctly, some of them (mentioned in error log) are not. I will try to find out differencies between both groups.
So what is correct method of backup and restore when trying to move hmailserver from one server to another? Backup was performed with all options selected, restore was also performed with all options selected.

tonda
Normal user
Normal user
Posts: 93
Joined: 2006-10-20 14:13
Location: CZ

Post by tonda » 2007-06-13 21:14

Really nobody has moved old server to new one between those two database engines? I really do not want to move all settings and messages manually...

User avatar
martin
Developer
Developer
Posts: 6837
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2007-06-13 21:51

I've done it before but haven't had any trouble. I will look into this during the upcoming weekend.

tonda
Normal user
Normal user
Posts: 93
Joined: 2006-10-20 14:13
Location: CZ

Post by tonda » 2007-06-14 09:38

Thank you Martin, what other information will you need from me? I can send to you my backup file, but it is quite large (about 170MB). I think I will be online during weekend so we can cooperate when collecting necessary informations.
Old system uses external MySQL database, latest hmailserver build.
New system uses MS SQL 2005 Express database, latest hmailserver build.
I use non-default folder for mail storage (d:\maildata), this change was performed in .ini file, hmailserver service was restarted and than restore was performed.

ad 1) problem was caused by accountvacationexpiredate column, when I manually edited .xml file with settings and replaced 0000-00-00 00:00:00 values (stored originally) by 2007-01-01 00:00:00, account import was successfull.

tonda
Normal user
Normal user
Posts: 93
Joined: 2006-10-20 14:13
Location: CZ

Post by tonda » 2007-06-14 16:24

ad message import. I have found that some messages in .xml backed up file have contain in Filename attribute whole path to file, including d:\maildata, so this is reason, why those messages was not possible to restore.
The only common attribute to these messages is, that have date older than 9.12.2006. Probably bug in older version of hmailserver, that caused this?

Post Reply