Page 1 of 1

Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-08 23:23
by jr3151006
I exported the user accounts from my old server with MYSQL, make some adjustment on the .CSV file and them imported it on the new server with MS-SQL, after that I changed the PASSWORD and seems to be fine.

But when I logged with these accounts (Roundcube interface), shows a msg like 'folder not found'.

>>> There is a way to import direct from HMAIL instead from MS-SQL as I tested?

tks,

Renato P

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-08 23:39
by percepts
was your old server using hmail? If so then you should do a backup using hmail built-in backup using compression.
Then restore to new server using same version of hmail. And then upgrade hmail if it was older version.

(hmail built in backup outputs to xml and will restore to any of the hmail database types providing hmail version is same as in backup)

If old server was not hmail then you must use some imap sync software to move data. Something like IMAPSYNC or http://home.arcor.de/armin.diehl/imapcopy/

You can load user account information (but not mail) using viewtopic.php?f=20&t=24810&sid=9ff512c2 ... 18#p151855

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-08 23:52
by percepts
ALSO

if old server was pre hmail version 5.4 then install location of hmailserver/data must be exact same path as on old server because absolute filepaths were used in pre 5.4 hmail. From 5.4 relative paths are used so you can put hmailserver/data folder anywhere providing hmailserver.ini points to it.

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 13:48
by jr3151006
Hi Percepts,

tks for quick reply but since the servers are different (OLD = W2003 + MySQL + v5.3 / NEW = W2012 + MS-SQL + v5.6) I´m not able to use the BUILT-IN Backup feature.

For this case, I'm just trying to create a lot of mailboxes quickly and I already used another tool (freeware) to migrate the IMAP Folder Structure as my old post (viewtopic.php?f=7&t=27287).

>>> I'll check the script in .VBS on the link that you post.

tks,

Renato P

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 14:30
by mattg
jr3151006 wrote:tks for quick reply but since the servers are different (OLD = W2003 + MySQL + v5.3 / NEW = W2012 + MS-SQL + v5.6) I´m not able to use the BUILT-IN Backup feature.
If the hmailserver versions were the same, and the database size was small enough, the backup >> restore should work fine

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 14:53
by percepts
an sql dump of the correct format with one db row per insert should be easily editable to MSSQl format for a simple load.
BUT it should be to same version of hmail as DB layout changes between major versions.

BUT it would be even easier if you retore to same version using hmail backup

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 17:11
by jr3151006
I was able to use your script to create new user, but right now I´m interested in how to export user accounts with all properties/parameters, from the old server to a file and then import on the new server.

As a second step, migrate contents with IMAPCOpy tool.

tks,

Renato P

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 17:38
by percepts
to make this whole process easier and less time consuming for us volunteers it would be helpful if you could do the following:

Run hmail backup on old system using all backup options including compression.

When you have done that let us know.

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 21:36
by jr3151006
But the backup will be restored at the new server?
The restore will reset all domain/account that already exists on the new server?

tks,

Renato P

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 21:58
by percepts
correct but you didn't say you had data in new server or that you wanted to "merge" two servers data.

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-09 22:05
by percepts
in that case you can do an sql dump of table hm_accounts using dump format of 1 row per insert. Then edit that file down into csv format for the script I pointed you at.

Then as for imapcopy you will have to follow their instructions. I never used it.

Re: Migration case - there is a way to import user accounts from .CSV?

Posted: 2014-12-10 18:11
by jr3151006
Percepts,

I´ll work on a script to dump all settings from old HMAIL's domains/accounts and also prepare as .CSV for your script.

tks,

Renato P