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

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 07-06-2011, 03:19 AM
Active Member
 
Posts: 35
Lightbulb Move mailboxes between two Zimbra servers in one organization (Script)

Hello everyone,

I've made a simple script for the bulk move from one ZCS to another. Servers have to be in one Zimbra Organization (use the same LDAP server, I suppose).

Script has been tested with ZCS 7.1.

There it is:

#########################

#!/bin/bash

declare -a arr

tmpFile=tmpfile.csv

target="target.server.FQDN"

/opt/zimbra/bin/zmprov gqu localhost > $tmpFile

arr=(` awk -F" " '{print $1}' $tmpFile`)

element_count=${#arr[@]}

index=0

while [ "$index" -lt "$element_count" ]

do
echo Preparing to move mailbox ${arr[$index]}.

/opt/zimbra/bin/zmmailboxmove -a ${arr[$index]} -t $target
/opt/zimbra/bin/zmmailboxmove -a ${arr[$index]} -po

((index++))

done

#########################

Any suggestions/improvements are welcome.
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.