email import/migration issues...

Discussion in 'General' started by alexolivan, Jan 22, 2015.

  1. alexolivan

    alexolivan Member

    Hi forum!
    playing around with ispconfig3 I'm trying to migrate some accounts from one server to a new one (switching from apache to nginx basically)... but I'm having problems with email import...
    Basically, I have cretaed an email domain on the target server on an account replicating the one on the old server.
    I have created a remote user on the old server, and I have used the email tool on the new one to connect from the target server to the old server... it seemed to work as sql stuff appeared...
    Then, as there is on both servers /var/vmail/ folders, I have rsynced them: new one with all the contents presents on the old one.

    At this point, data is present on both servers, and I can use login credentials normally, but old emails are not there... accounts lokk like empty... I'm sure I'm missing something!
    Does anyone have a clue?

    Thank you in advance
    Best regards to everyone!
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Does the old and new server uses the same imape damon (courier or dovecot) as they have different mayldir layouts, if you rsync data from dovecot to courier or vice versa, then themaildir structure has to be converted.
  3. alexolivan

    alexolivan Member

    ... direct hit!
    Old one is old perfect server setup apache + courier while new one is nginx + dovecot

    so... there should be a way to address it... I hope
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. alexolivan

    alexolivan Member

    ok... googling around there is some IspConfig3 posts not focused on email / server migration but on courier to dovecot transsition.
    There is mention to a migration script, but I'm not sure how to port ths to my scenario:
    The new server has simply the vmail structure rsynced, but there has not ever been a courier running on it.
    By examining a courier_to_dovecot.zipped script it seems to be designed to be used on a machine that has both types of folder structures in a kind of transition from service types.
    Also, there seems to be some perl scrps on dovecot site to perform migration... but I dont dare to try something outside IspConfig3 design.
  6. alexolivan

    alexolivan Member

    That's exacty where I was... so I'm close.

    The problem is I do not understand the logic described on the README.txt file, since it is designed to switch from one service to the other.
    In theory, none of the early steps apply... also.. why should I update ISPConfig? it isalready on the latest version... it talks about reconfiguring squirrelmail, but the server has roundcube instead... this makes me doubt about the entire procedure

    The only thing I imagine I could try is simply run the php script from the NEW server against the remoting user on the OLD one...
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    This does not matter for the script, it should be ok to run it on your new server to do the conversion. you can do this manually as well, the main difference is:

    courier path: /var/vmail/domain.tld/
    dovecot path: /var/vmail/domain.tld/Maildir/

    so the content of domain.tld/ directory on your old server has to be in domain.tld/Maildir/ directory of the new server.
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    This wont be good as it would mess up the old system. Maybe a manual change of the directories is the best choice.
  9. alexolivan

    alexolivan Member

    Uffff.... fortunately I'm very curious on how things work... by examinin the php code I was feeling very unsafe on using it on the NEW server.
    For the shake of information, is this php script in fact designet to be run FROM the OLD server , agains a remoting user on the NEW server, isn'it?
  10. alexolivan

    alexolivan Member

    ....mmmm I like the manual approach...
    but there seems to be a difference

    what I have is



    I suppose this is not an anomaly on my server...
    I'm gonna try to move them... I'm thinking on a shell script to do it for people on production environments with plenty of accounts... fortunately I'm working with just a domain with a pair of personal testing accounts :)
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    The script is for converting one existing server from courer to dovecot, no new or old system.
  12. alexolivan

    alexolivan Member

    Got it:
    Currently it is as simple as running rsync for every domain/mailbox, since it preserver permissions.
    I prefer rsync pulling from the new server in order to preserve old data... so the commant was like that:
    /usr/bin/rsync -azcv [email protected]:/var/vmail/doamin.tld/myuser/ /var/vmail/domain.tld/myuser/Maildir/

    It would be great doing a script that loops every domain/mbox combination and pulls the data...

    But thats another history!
    Should br marked as SOLVED

    Thank you very much again for your time Mr Till!
    Best regards.

Share This Page