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 to the forums! We encourage you to explore all things Zimbra with our team and members of the community. If you would like to post a comment, please register and review our posting policy.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-26-2008, 02:48 AM
Intermediate Member
 
Join Date: Sep 2008
Posts: 15
hinyinlam is on a distinguished road
Talking 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, 130 views)
__________________
SME Solutions, Solution customization, web development.
HinYinSolution
HKTutorGuide
HKTutorBank
MustHaveTutor
HKTopTutor

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
 
Join Date: Sep 2008
Posts: 15
hinyinlam is on a distinguished road
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, 76 views)
__________________
SME Solutions, Solution customization, web development.
HinYinSolution
HKTutorGuide
HKTutorBank
MustHaveTutor
HKTopTutor
Reply With Quote
  #3 (permalink)  
Old 09-29-2008, 10:27 PM
mmorse's Avatar
Zimbra Employee
 
Join Date: May 2006
Location: USA
ZCS Version: 5.0.x - NE & FOSS
Posts: 5,271
mmorse is on a distinguished road
Send a message via AIM to mmorse Send a message via MSN to mmorse Send a message via Yahoo to mmorse Send a message via Skype™ to mmorse
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
 
Join Date: Sep 2008
Posts: 15
hinyinlam is on a distinguished road
Default

how's the checkpoint values generated?
any algorithm?
__________________
SME Solutions, Solution customization, web development.
HinYinSolution
HKTutorGuide
HKTutorBank
MustHaveTutor
HKTopTutor
Reply With Quote
  #5 (permalink)  
Old 10-08-2008, 09:29 PM
Intermediate Member
 
Join Date: Sep 2008
Posts: 15
hinyinlam is on a distinguished road
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, 36 views)
__________________
SME Solutions, Solution customization, web development.
HinYinSolution
HKTutorGuide
HKTutorBank
MustHaveTutor
HKTopTutor
Reply With Quote
  #6 (permalink)  
Old 10-09-2008, 03:52 PM
ThorGoLucky's Avatar
Loyal Member
 
Join Date: Jun 2006
Location: Corvallis, Oregon, USA
Posts: 77
ThorGoLucky is on a distinguished road
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
 
Join Date: Sep 2008
Posts: 15
hinyinlam is on a distinguished road
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
__________________
SME Solutions, Solution customization, web development.
HinYinSolution
HKTutorGuide
HKTutorBank
MustHaveTutor
HKTopTutor
Reply With Quote
  #8 (permalink)  
Old 10-14-2008, 09:24 PM
Intermediate Member
 
Join Date: Sep 2008
Posts: 15
hinyinlam is on a distinguished road
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, 95 views)
__________________
SME Solutions, Solution customization, web development.
HinYinSolution
HKTutorGuide
HKTutorBank
MustHaveTutor
HKTopTutor
Reply With Quote
  #9 (permalink)  
Old 10-16-2008, 07:22 AM
Ger Ger is offline
Junior Member
 
Join Date: Sep 2008
Posts: 7
Ger is on a distinguished road
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
 
Join Date: Sep 2008
Posts: 15
hinyinlam is on a distinguished road
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.
__________________
SME Solutions, Solution customization, web development.
HinYinSolution
HKTutorGuide
HKTutorBank
MustHaveTutor
HKTopTutor
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
admin consol blank after 5.0.3 upgarde maumar Administrators 6 03-21-2008 06:16 AM
[SOLVED] Zimbra 5.0.2_GA_1975_RHEL setup CentOS 5.1 problem evolus Installation 12 02-25-2008 07:28 PM
Post instsallation problems Assaf Installation 14 01-29-2007 11:38 AM
3.1 on FC4 problems cohnhead Installation 8 05-26-2006 12:16 PM
port 7071 not listening OS X install rm* Installation 7 03-21-2006 10:47 AM

Interested in ZCS Network Edition?

Please fill out this brief form so we can follow up with you.

Comcast Customer?

Please read this FAQ.

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and removes this extra sidebar.

Zimbrablog.com

freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.1.0