Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Migration

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-26-2008, 02:48 AM
Intermediate Member
 
Posts: 20
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
File Type: zip Zimbra2Zimbra.zip (1.6 KB, 1039 views)
__________________
I can provide custom solution for Zimbra to Zimbra migration.

Move your mailboxes individually or just item inside each mailbox

Last edited by hinyinlam; 10-24-2008 at 09:38 AM.. Reason: New version!
Reply With Quote
  #2 (permalink)  
Old 09-29-2008, 08:59 PM
Intermediate Member
 
Posts: 20
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
File Type: zip Zimbra2Zimbrazip.zip (5.5 KB, 298 views)
__________________
I can provide custom solution for Zimbra to Zimbra migration.

Move your mailboxes individually or just item inside each mailbox
Reply With Quote
  #3 (permalink)  
Old 09-29-2008, 10:27 PM
Moderator
 
Posts: 6,236
Default

Nice usage of mysqldump & I like your logic for managing the store blobs - quite ingenious!
Reply With Quote
  #4 (permalink)  
Old 09-30-2008, 01:42 AM
Intermediate Member
 
Posts: 20
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
Reply With Quote
  #5 (permalink)  
Old 10-08-2008, 09:29 PM
Intermediate Member
 
Posts: 20
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
File Type: zip Zimbra2Zimbra.zip (5.7 KB, 161 views)
__________________
I can provide custom solution for Zimbra to Zimbra migration.

Move your mailboxes individually or just item inside each mailbox
Reply With Quote
  #6 (permalink)  
Old 10-09-2008, 03:52 PM
Loyal Member
 
Posts: 90
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!
Reply With Quote
  #7 (permalink)  
Old 10-09-2008, 08:28 PM
Intermediate Member
 
Posts: 20
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
Reply With Quote
  #8 (permalink)  
Old 10-14-2008, 09:24 PM
Intermediate Member
 
Posts: 20
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
File Type: zip ZimbraZimbraMigration.zip (2.0 KB, 591 views)
__________________
I can provide custom solution for Zimbra to Zimbra migration.

Move your mailboxes individually or just item inside each mailbox
Reply With Quote
  #9 (permalink)  
Old 10-16-2008, 07:22 AM
Ger Ger is offline
Junior Member
 
Posts: 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!
Reply With Quote
  #10 (permalink)  
Old 10-17-2008, 01:07 AM
Intermediate Member
 
Posts: 20
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.