Command to export and import account data

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
theboina
Advanced member
Advanced member
Posts: 69
Joined: Sat Sep 13, 2014 1:41 am

Command to export and import account data

Postby theboina » Sun Jul 17, 2011 11:36 am

¿what is the command line to export and import an account of a domain from one server to another?
(to do the same as the preferences account ==> import /export)
Thx


theboina
Advanced member
Advanced member
Posts: 69
Joined: Sat Sep 13, 2014 1:41 am

Command to export and import account data

Postby theboina » Sun Jul 17, 2011 5:22 pm

can only be done from preferences ==> Import / Export? I would like to make a script for a massive export of a domain in bash command line.
Thx
theboina
Advanced member
Advanced member
Posts: 69
Joined: Sat Sep 13, 2014 1:41 am

Command to export and import account data

Postby theboina » Sun Jul 17, 2011 6:25 pm

Im going to do it with:
/usr/bin/curl -s -k -u admin:password https://zimbraserver:7071/home/${ACCOUNT}@yourdomain.de/?fmt=tgz | /bin/zcat | /bin/gzip -9 --rsyncable > ${TEMPDIR}/${ACCOUNT}/${ACCOUNT}.tgz

(cd ${TEMPDIR} && /usr/bin/rdiff-backup ${ACCOUNT} ${BACKUPDIR}/${ACCOUNT} )
dzubik
Posts: 2
Joined: Sat Sep 13, 2014 2:20 am

Command to export and import account data

Postby dzubik » Wed Dec 07, 2011 1:55 am

And... does it work? Is it a reliable way to command line account export from ZCS?
gucito
Posts: 2
Joined: Wed Jul 05, 2017 10:28 am

Re: Command to export and import account data

Postby gucito » Wed Jul 05, 2017 10:34 am

Hola este script me ayudo a exportar todo los usuarios de zimbra en un archivo tgz, este mismo scripts esta en este foro,

Code: Select all

#!/bin/bash
for i in `zmprov gqu localhost | grep example.com|awk {'print $1'}`; do
    echo $i
    file=`echo $i | awk -F '@' '{print $1}'`
    /opt/zimbra/bin/zmmailbox -z -t 0 -m "${i}" getRestURL -u "https://mail.example.com" "//?fmt=tgz" > /tmp/${file}.tgz
done


Lo que no pude es como importar luego esos archivos, si alguien tuviera ese scripts estare muy agradecido,

Espero que les sirva!

Return to “Administrators”

Who is online

Users browsing this forum: Google [Bot] and 16 guests