HowTos/Migrate Scalix
Scalix Wiki -> How-Tos -> Migrate Scalix to a new server
For one reason or another I have had to re-install our scalix server a few times now and manually adding the user credentials, email addresses and the such has been quite boring. We are looking to move to a bigger server now and i have the task of doing it again.
70 users, some limited, over 100 email addresses - its going to take a while.
I have created a small script that echo's the user settings out.
Used in conjunction with the sxmboxexport script elsewhere on this wiki the migration will be much quicker.
NEWMAILNODENAME=mail SXDIR=/opt/scalix/bin for i in $(${SXDIR}/omshowu -m all | cut -d "/" -f 1 | sed -e 's: $::g' -e 's/ /\//g'); do USER=`printf "$i" | sed -e 's:/: :g'` ADDRESSES=IA PARAMS= USERD=`${SXDIR}/omshowu -n "${USER}"` if [ `echo $USERD | grep "User Class : Limited" |wc -l` == 1 ]; then PARAMS=$PARAMS" --class limited" fi for g in $(echo $USERD | grep -o "<[[:alnum:][:graph:]]*@[[:alnum:][:graph:]]*>"); do ADDRESSES=$ADDRESSES"="\"${USER}\"" "$g done echo ${SXDIR}/omaddu -n \'${USER}/${NEWMAILNODENAME}/${ADDRESSES}\' $PARAMS done
- Please note the NEWMAILNODENAME needs to be set to your new mailnode.
To use this script paste it into a file called dumpscript.sh then execute the script:
sh dumpscript.sh | import.sh
After copying the file to the new installation (scalix MUST be installed and working first) execute the import.sh script.
What the script exports:
- User name
- User level (i.e. full/limited)
- User email addresses
What the script doesn't set or export:
- Login name - [[1]]
- Password - unextractable (AFAIK)
- Smartcache enabled/disabled
- User specific company details - position etc
- Add to global mailbox check - not part of omaddu (AFAIK)
- export user mailboxes (yet)