Page 1 of 4 123 ... LastLast
Results 1 to 10 of 39

Thread: [SOLVED] Zimbra to Zimbra Migration Script

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    7

    Talking [SOLVED] Zimbra to Zimbra Migration Script

    Hi
    VERSION 2.03 IS OUT! SEE THE LAST REPLY!
    Since I have problem transferring the old Zimbra to my Zimbra installation, I have decided to write a script to automatically transfer all data to the new installation. The old and new installation are of different domain! <-- so migrate to another domain is possible!

    Best of all, interruption for the source server is minimum as you can first rsync the data and then later on move it to the new server

    Assumption
    1. since this script don't setup anything for you, it just move user's data to the correct position, please setup your Zimbra, create users USING SAME NAME----<username>@source_server.com and <username>@target_server.com will be consider the same person!

    2. I assume the source server and SSH without password to the target server, I also assume you are root user, setup any SSH authen permission etc.....

    3. I assume both target and source servers are of the same Zimbra version

    4. I assume that this script MAY corrupt your data, making your users upset, BACKUP BACKUP AND BACKUP (just tar jcvf zimbra.tar.bz2 /opt/zimbra! so simple!)
    5. I am not responsible for any damages caused by the script, provided as is.
    6. I assume you will give some response and submit some feature/bug to me, ok?

    Precedure
    1. start both server's Zimbra, edit the parameters in the script file
    2. in source server (where you want the data copy from), run Zimbra2Zimbra.sh
    3. run /opt/zimbra/libexec/zmfixperms

    Done!
    Attached Files Attached Files
    Last edited by hinyinlam; 10-24-2008 at 09:38 AM. Reason: New version!
    I can provide custom solution for Zimbra to Zimbra migration.

    Move your mailboxes individually or just item inside each mailbox

  2. #2
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    7

    Exclamation Version 2 is out!

    This version fixed many issues and improved stability by simplifying codes.
    It works as the followings:
    1. you created accounts on both servers with same names (ie on source server abc@123.com and target server abc@any_other_domain.com)
    2. it will then get mailbox id of abc@123.com from source server and abc@any_other_domain.com from target server
    3. it will convert all database things from abc@123.com to abc@any_other_domain.com
    4. copy all mapped mailbox to destination
    5. restart the target server so make everything fresh

    Fixed issues:
    1. duplicate object exists during send email
    2. no such mailbox/ no such folder error during login

    Improvement:
    1. split script into two parts: Source Server and Target Server part to improve stability
    2. speed up SQL processing
    3. use soft link to map mailbox instead of moving it, so repeatedly run the script will don't have to rsync from scratch, so any interrupted/inconsistent will be fixed very quick

    How to use:
    1. source server must have root access to target server using passwordless SSH, ie ssh <target_server> don't have to type password
    2. unzip my scripts, chmod +x them
    3. run Zimbra2Zimbra.sh

    Please give some comment on the script
    Attached Files Attached Files
    I can provide custom solution for Zimbra to Zimbra migration.

    Move your mailboxes individually or just item inside each mailbox

  3. #3
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Nice usage of mysqldump & I like your logic for managing the store blobs - quite ingenious!

  4. #4
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    7

    Default

    how's the checkpoint values generated?
    any algorithm?
    I can provide custom solution for Zimbra to Zimbra migration.

    Move your mailboxes individually or just item inside each mailbox

  5. #5
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    7

    Exclamation Version 2.01 is Out!

    Improvement:
    Since sometime the target server / source servers are busy, rsync and sed will occupy too much IO resource (ie too aggressive), use of IONice with the lowest priority will avoid killing your server, especially those who use LVM snapshot in combine with dm-crypt
    Attached Files Attached Files
    I can provide custom solution for Zimbra to Zimbra migration.

    Move your mailboxes individually or just item inside each mailbox

  6. #6
    Join Date
    Jun 2006
    Location
    Corvallis, Oregon, USA
    Posts
    100
    Rep Power
    9

    Default

    Hi, will this script work if the Service Host Name is different on the new server?

    old mail.mu.university.edu --> new mail.nonprofitcorporation.com

    Thanks!

  7. #7
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    7

    Default

    sure!
    see in the Target.sh line 1:
    IGNORE_DOMAIN_DIFFERENCE=1
    meaning that the script will only match username
    ie <username>@mail.mu.university.edu will match <username>@mail.nonprofitcorporation.com
    I can provide custom solution for Zimbra to Zimbra migration.

    Move your mailboxes individually or just item inside each mailbox

  8. #8
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    7

    Default Version 2.02 is out!

    Improvement:
    Rsync now know how to delete non-exist files and build hardlinks on the target server
    What a space saving!
    Attached Files Attached Files
    I can provide custom solution for Zimbra to Zimbra migration.

    Move your mailboxes individually or just item inside each mailbox

  9. #9
    Join Date
    Sep 2008
    Posts
    7
    Rep Power
    7

    Default migrating ldap

    Hello people.
    Last week I decided to migrate one domain, to another zimbra server because I need to give a client of the company where I work, the managment of the accounts from his domain, Iīve notice that I could do it with network edition of zimbra, but my cheff doesenīt want to buy the licence, and I would have to migrate the whole server to the newone with network edition too. thatīs not what I wanted.
    so, I have two posibilites to do it, the first and easy one, would be to migrate the accounts from the domain, passwords, mailboxes and all the caracteristics of each account to the new server, but I really donīt know how can I do it, the second posibility, is to clone one server to the other, and change the pubiic IP on the dns server for that domain. but Iīm having problems with ldap, first of all, I want to duplicate the ldap database from old server to new server. but when I run zmcontrol start, it starts all services OK and when starts ldap I recive the message "Unable to determine enabled services from ldap, Enabled services read from cache. Service list may be inaccurate" and I cannot access to webmin. I thought it has something to do with /etc/hosts or resolving mx records, but I could bring up a zimbra server without A and MX record, and a functionaling /etc/hosts. so that isnīt the problem.

    Can you give me please some help about it?
    thank you for reading this large question, and sorry for my bad english!

  10. #10
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    7

    Default

    Quote Originally Posted by Ger View Post
    Hello people.
    Last week I decided to migrate one domain, to another zimbra server because I need to give a client of the company where I work, the managment of the accounts from his domain, Iīve notice that I could do it with network edition of zimbra, but my cheff doesenīt want to buy the licence, and I would have to migrate the whole server to the newone with network edition too. thatīs not what I wanted.
    so, I have two posibilites to do it, the first and easy one, would be to migrate the accounts from the domain, passwords, mailboxes and all the caracteristics of each account to the new server, but I really donīt know how can I do it, the second posibility, is to clone one server to the other, and change the pubiic IP on the dns server for that domain. but Iīm having problems with ldap, first of all, I want to duplicate the ldap database from old server to new server. but when I run zmcontrol start, it starts all services OK and when starts ldap I recive the message "Unable to determine enabled services from ldap, Enabled services read from cache. Service list may be inaccurate" and I cannot access to webmin. I thought it has something to do with /etc/hosts or resolving mx records, but I could bring up a zimbra server without A and MX record, and a functionaling /etc/hosts. so that isnīt the problem.

    Can you give me please some help about it?
    thank you for reading this large question, and sorry for my bad english!
    my script may work with Network<-->OpenSource or OpenSource<-->Network version because the part that the script change should be the same between different editions

    unable to determine enabled services may be because of ssh login issues.
    I can provide custom solution for Zimbra to Zimbra migration.

    Move your mailboxes individually or just item inside each mailbox

Similar Threads

  1. admin consol blank after 5.0.3 upgarde
    By maumar in forum Administrators
    Replies: 6
    Last Post: 03-21-2008, 06:16 AM
  2. Replies: 12
    Last Post: 02-25-2008, 07:28 PM
  3. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 11:38 AM
  4. 3.1 on FC4 problems
    By cohnhead in forum Installation
    Replies: 8
    Last Post: 05-26-2006, 12:16 PM
  5. port 7071 not listening OS X install
    By leeimber in forum Installation
    Replies: 7
    Last Post: 03-21-2006, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •