Welcome, Guest
Please Login or Register.
Lost Password?
Re:Import email account from MySQL 4.x to MySq 5.x? (1 viewing)
Post Reply

TOPIC: Re:Import email account from MySQL 4.x to MySq 5.x?

#14171
nomadman (User)
Posts: 14
graphgraph
Import email account from MySQL 4.x to MySq 5.x? 2008/06/25 09:01  
SOLVED

I have a few hundred email accounts from our old dmail mail server using postfix/mysql 4 and I need to import them to the current virtualmin installation. Is it possible to dump and then import them without losing password and/or alias's? If possible, can someone please point me in the right direction?

Thank you

Post edited by: nomadman, at: 2008/06/27 04:45
CentOS 5.2
Virtualmin GPL
  The administrator has disabled public write access.
#14187
Joe (Admin)
Posts: 3798
graph
Re:Import email account from MySQL 4.x to MySq 5.x? 2008/06/25 15:01  
Bulk actions are easy (and there are a couple of ways to do it in Virtualmin--both command line and the GUI have batch capabilities).

Passwords are the hard part. Are they encrypted on your old system? If so, are they encrypted via either MD5 or crypt? If it's any other format, you're probably out of luck, since those are the only two formats you can drop into /etc/shadow.
  The administrator has disabled public write access.
#14200
nomadman (User)
Posts: 14
graphgraph
Re:Import email account from MySQL 4.x to MySq 5.x? 2008/06/26 04:41  
Hi Joe,

The passwd is encrypted in crypt. Is there a tutorial I've overlooked in the wiki explaining how to migrate mail from one server to another? I think I have all the prerequisites in order to migrate from the old system. Can you please point me in the right direction to a tutorial? Are bulk actions available in the GPL version?

Thank you
CentOS 5.2
Virtualmin GPL
  The administrator has disabled public write access.
#14214
Joe (Admin)
Posts: 3798
graph
Re:Import email account from MySQL 4.x to MySq 5.x? 2008/06/26 15:24  
No tutorials that I'm aware of.

The batch import mode in the GUI is currently only available in Virtualmin Professional, so you'll need to use the command line option shown below (which is actually probably better for most cases where a lot of data is being dealt with).

The GUI batch import feature requires you to visit each virtual server and import each group of domains individually...so if you have hundreds of domains with one or two users each, you're in for a world of pain using the GUI. Anyway (for anyone following along that does have Professional), to get there, and to see the help, browse to "Edit Mail and FTP Users" for the virtual server you want to work on, and click the "Batch create users". Once on that form, you can click "Help.." to get complete information about the file format...it's basically a passwd-style file (i.e. colon-delimited list), though the fields are different to accommodate the various available features. You can leave fields blank, for options you don't need or care about.

The command line tool ''create-user.pl'' will allow you to write a simple shell script (or whatever language you like) to pull the data out of whatever your source is and act on it, based on whatever decisions need to be made to figure out which domain will contain which user. All of the command line tools now have good documentation thanks to a herculean effort by Jamie a few days ago:

http://www.virtualmin.com/documentation/id,virtualmin_api_create_user/

I'm pretty sure all of the basic ''create-*'' commands are available in GPL. If they aren't, they should be...so let me know if you don't have it, and I'll make sure it gets into the next release (the rule we go by for the commands is: create, list, update, delete, actions go into GPL, while nothing more complex does...Professional has full command line coverage of every option in the UI in both command line and remote APIs).
  The administrator has disabled public write access.
#14215
Joe (Admin)
Posts: 3798
graph
Re:Import email account from MySQL 4.x to MySq 5.x? 2008/06/26 15:27  
Actually, now that I'm looking at the create-user docs...it looks like pre-crypted passwords aren't going to work there. I'll ask Jamie to chime in, as it seems like it'd be a pretty common use case to have pre-crypted or MD5 hashed passwords...and for almost every purpose, that's OK.
  The administrator has disabled public write access.
#14217
JamieCameron (Admin)
Posts: 342
graphgraph
Re:Import email account from MySQL 4.x to MySq 5.x 2008/06/26 16:15  
Joe's right - at the moment, there is no way to set a pre-encrypted password when using create-user.pl. I will add this in the next release of Virtualmin though.

If you want this feature urgently, you can email me directly and I'll send you an updated version of just that script.
  The administrator has disabled public write access.
#14221
nomadman (User)
Posts: 14
graphgraph
Re:Import email account from MySQL 4.x to MySq 5.x 2008/06/26 21:48  
Thanks for the prompt reply Joe and Jamie. Jamie, I'd like to work on the script over the weekend, so I would really appreciate it if you can email me the new one. It seams that I'm not able to find your email address or any type of PM option on this board. So if you can, please email me the script at rommel[at]uno.net.ph
CentOS 5.2
Virtualmin GPL
  The administrator has disabled public write access.
#14224
JamieCameron (Admin)
Posts: 342
graphgraph
Re:Import email account from MySQL 4.x to MySq 5.x 2008/06/27 04:16  
Sure, I will email it to you now ..
  The administrator has disabled public write access.
#14225
nomadman (User)
Posts: 14
graphgraph
Re:Import email account from MySQL 4.x to MySq 5.x 2008/06/27 04:44  
Thank you Jamie. Thank you both for your assistance. I guess if I any questions about the new script, I'll create it' own tpic instead of coming back to this thread.

Thank you
CentOS 5.2
Virtualmin GPL
  The administrator has disabled public write access.
#14748
badens (User)
Posts: 1
graphgraph
Re:Import email account from MySQL 4.x to MySq 5.x 2008/07/14 02:23  
HI Jamie,

I have a similar problem with encrypted passwords, could you please email me your latest version of the script to badensATgmail.com?

Thanks very much for your time.
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.