Migration to new server and mbox to Maildir

Discussion in 'Installation/Configuration' started by rbartz, Feb 13, 2009.

  1. rbartz

    rbartz Member HowtoForge Supporter

    I am looking forward this weekend to moving about 60 domains from one old ispconfig server to a new one. The old one (Fedora Core 3) uses mbox and the now server (Core 10) will use Dovecot with Maildir...

    So I will be converting about 300 mailboxes. Is the any way I can extract a list of users with "groups" from the ispconfig database?

    If I can get that info, as in user = "admin", group = "web1" then I can create the maildirs in all the right places (/var/www/web1/user/admin/), set permissions, and then convert the mail from the /var/spool/mail directory with perfect_maildir just before the move, and just maybe have a working mail system after the migration.

    Thanks in advance...

    Richard
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Are you using username prefixes in ISPConfig (like web1_)? If so, the users have the group in their usernames. :)
     
  3. rbartz

    rbartz Member HowtoForge Supporter

    Ah yes, had we had the wisdom to use web#_ prefixes in the first place, this would have been simple. However, way back then we were moving sites from an existing NON-ispConfig server and there were already dozens of user names and passwords and domains... so we took the EASY way out then, and now we pay.

    Hint for those who want to disable the default way of creating users. Don't... there are good reasons not to.

    Anyway, I was able to retrieve a group/user/home directory list via webmin from the user and groups table page therein, and with some manipulation created all the necessary Maildir directories on the OLD server.

    I will shut down the mail and convert all the mboxes and then do a rsync of the www directory tomorrow, which should put all the old mail in place on the new server so that when we change the DNS and nameservers to point to it, things will start and run right.

    I am looking forward to version 3 where, hopefully, we will be able to move a client and site with mail users and ftp logins and everything else from one server directly to another with a click and approve. That would be neat.

    If anyone has taken time to put together the sql to pull users@domain or users and webs from the ispConfig database tables, it would be useful if for nothing else than creating server wide mail lists and so on.

    Thanks Falko,

    Richard
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Try this SQL query:

    Code:
    SELECT parent_doc_id FROM isp_dep WHERE child_doc_id = '$doc_id' AND child_doctype_id = 1014
    ($doc_id is the doc_id of the user. The group would be "web" + the parent_doc_id.)
     

Share This Page