bggo / Zmbkpose

The zmbkpose tool is a shell script that does hot backup and hot restore of ZCS Opensource accounts, GPL(OPENSOURCE). It can run from any host in the net, which means that it can be set on a backup server already existent.
http://wiki.zimbra.com/wiki/HOT_Backup_and_HOT_Restore
GNU General Public License v3.0
79 stars 55 forks source link

zmbkpose resaurar #18

Closed fcavalcante closed 12 years ago

fcavalcante commented 12 years ago

Olá,

estou com problemas para restaurar um aquivo de backup.

o arquivo comprimido tem 9.9G

servidor CentOS 5 zimbra 7.2

em uma maquina com um giga de ram da o erro:

ambkpose -r conta@dominio.org.br full-20120522174726

curl: (27) out of memory

em uma maquina com 8G de ram da o erro: zmbkpose -r conta@dominio.org.br full-20120522174726


com.zimbra.cs.service.formatter.FormatterServiceException: Unexpected end of ZLIB input stream
ExceptionId:btpool0-8://servidor.dominio.org.br:7071/home/conta@dominio.org.br/?fmt=tgz:1342044883099:d489729fdc4c9d64
Code:formatter.UNKNOWN_ERROR

Obrigado,

liandros commented 12 years ago

2012/7/11 fcavalcante reply@reply.github.com:

Olá,

estou com problemas para restaurar um aquivo de backup.

o arquivo comprimido tem 9.9G

servidor CentOS 5 zimbra 7.2

em uma maquina com um giga de ram da o erro:

ambkpose -r conta@dominio.org.br full-20120522174726

curl: (27) out of memory

em uma maquina com 8G de ram da o erro: zmbkpose -r conta@dominio.org.br full-20120522174726 com.zimbra.cs.service.formatter.FormatterServiceException: Unexpected end of ZLIB input >streambr>ExceptionId:btpool0-8://servidor.dominio.org.br:7071/home/conta@dominio.org.br/?fmt=tgz:1342044883099:d489729fdc4c9d64<brCode:formatter.UNKNOWN_ERROR

Desculpe, eu não falo Português, mas acho que você pode entender Inglês ou espanhol . Respondo em ambas as línguas 9.9G ? --> OUCH!!!!

################################################################################ English: curl cannot get sufficient memory for build the request. Try save memory skipping the web service. Use zimbra user. Import the backup as follow: $ /opt/zimbra/bin/zmmailbox -z -m UserEmailAddress postRestURL "//?fmt=tgz&resolve=reset" backup.tgz

You may get the following error: ERROR: zclient.IO_ERROR (Broken pipe) (cause: java.net.SocketException Broken pipe)

Agree http://www.zimbra.com/forums/administrators/47949-recovery-tgz-mail-file-fails.html , you can try using $ zmmailbox -z -m account>@<yourmailserver.com addMessage /Inbox *.eml

Note1: zmmailbox can use a directory argument, but it not examines recursivly, and not filters eml files. Note2: Each directory must exist on the destination mailbox, otherwise you get an error. See below for a script for filter eml files, and create each directory in destination mailbox. untar your backup.tgz file, and use zimbra user as follow: $ script account@yourmailserver.com your_decompress_backup_dir and patience ..... ################################################################################ Espanhol: curl no puede obtener la memoria suficiente para construir el requerimiento. Intenta ahorrar memoria sin hacer uso del servicio web. Usa el usuario zimbra, intenta importar el backup usando : $ /opt/zimbra/bin/zmmailbox -z -m UserEmailAddress postRestURL "//?fmt=tgz&resolve=reset" backup.tgz

Puede que obtengas el sig. error : ERROR: zclient.IO_ERROR (Broken pipe) (cause: java.net.SocketException Broken pipe)

De arcuerdo a http://www.zimbra.com/forums/administrators/47949-recovery-tgz-mail-file-fails.html puedes intentar usando: $ zmmailbox -z -m account>@<yourmailserver.com addMessage /Inbox *.eml

Nota 1: zmmailbox puede usar una directorio como argumento, pero no lo examina recursivamente, y no filtra por archivos eml. Nota 2: Cada directorio debe existir en el mailbox destino, de lo contrario obtendrá un error. A continuación se muestra un script que se puede usar para hacer el filtrado de archivos eml, y crear cada directorio (si no existe) en el mailbox. Descomprime tu archivo de backup tgz, y ejecuta este script con usuario zimbra como sigue : $ script account@yourmailserver.com tu_dir_de_backup_descomprimido y paciencia ################################################################################

!/bin/bash

set -e email=$1 bkdir="$2" zmmailbox_bin=/opt/zimbra/bin/zmmailbox mb_folders=/tmp/mbox_folders

cd "$bkdir" || exit 1

Get actual folders

while read Id View Unread Msg_Count Path ;do [ -z "$Path" ] || echo $Path done<<EOF |grep '^/.' > $mb_folders $($zmmailbox_bin -v -z -m $email getAllFolders) EOF

Import messages

while read dir;do

Folder exists?

egrep -q "^${dir#.}$" $mb_folders || $zmmailbox_bin -v -z -m $email createFolder "${dir#.}"

Import messages in dir

find "$dir" -mindepth 1 -maxdepth 1 -type f -regex '.*.eml' -print0 |\ xargs -L 10 -0 -r $zmmailbox_bin -v -z -m $email addMessage "${dir#.}" done<<EOF $(find . -mindepth 1 -type d ) EOF

fcavalcante commented 12 years ago

hello,

sorry for long time.

could recover messages individually, but I noticed that gave some coding error, because there were accents in file names.

Thank you.