[SOLVED] Backup / Restore with tgz formatter

Looking to migrate to ZCS? Ask here. Got a great tip or script that helped you migrate? Post it here.
Post Reply
Service
Elite member
Elite member
Posts: 1023
Joined: Tue Apr 14, 2009 2:44 pm

[SOLVED] Backup / Restore with tgz formatter

Post by Service »

Hello,
I am using these 2 commands for migrating accounts from server 1 to server 2 (both in the same version) :
/opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL “//?fmt=tgz” > /tmp/account.tgz
and
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL “//?fmt=tgz&resolve=reset” /tmp/account.tgz
But now I want to use the same method for a 'update' operation on the same server for a test from version 5.0.18 to 6RC1
But it seems that the tgz file resulting in the backup on version 5 in not compatible with tgz for version 6 ???
As I can't use imapsync, what other tool I can use ?
Thanks.
PS : sorry, but this post should be in the 'Migration' forum.
Service
Elite member
Elite member
Posts: 1023
Joined: Tue Apr 14, 2009 2:44 pm

[SOLVED] Backup / Restore with tgz formatter

Post by Service »

Can I just copy the 'store' folder ?
What will I loose if I use this trick ? I read that I may loose 'metadata', ok but what are metadata ?
With this trick, if think that the index is not copied too, is the index can be recreated ? what is it used for ?
And what about the database ? as between v5 et v6 schema as changed, I don't know how to reimport data from the database. Is it really important ?


Thanks.
Service
Elite member
Elite member
Posts: 1023
Joined: Tue Apr 14, 2009 2:44 pm

[SOLVED] Backup / Restore with tgz formatter

Post by Service »

Here is the ouput that the version 6 gave me for a restoration of a backup of the version 5.0.18 :
ERROR: service.FAILURE (system failure: POST failed, status=500 system failure: tgz formatter failure)

com.zimbra.common.service.ServiceException: system failure: POST failed, status=500 system failure: tgz formatter failure

ExceptionId:main:1251446767295:aaf27a255c491475

Code:service.FAILURE

at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:251)

at com.zimbra.cs.zclient.ZMailbox.postRESTResource(ZMailbox.java:2624)

at com.zimbra.cs.zclient.ZMailboxUtil.doPostRestURL(ZMailboxUtil.java:2691)

at com.zimbra.cs.zclient.ZMailboxUtil.execute(ZMailboxUtil.java:1114)

at com.zimbra.cs.zclient.ZMailboxUtil.main(ZMailboxUtil.java:2574)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.zimbra.common.util.ConsoleRunner.main(ConsoleRunner.java:96)
Service
Elite member
Elite member
Posts: 1023
Joined: Tue Apr 14, 2009 2:44 pm

[SOLVED] Backup / Restore with tgz formatter

Post by Service »

Nervermind, I managed to use imapsync finally.
mtanzer
Posts: 36
Joined: Fri Sep 12, 2014 10:39 pm

[SOLVED] Backup / Restore with tgz formatter

Post by mtanzer »

Actually ist is NOT solved. This is a workaround.
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

[SOLVED] Backup / Restore with tgz formatter

Post by phoenix »

[quote user="mtanzer"]Actually ist is NOT solved.[/QUOTE]..... and the point of adding this to a thread that's almost four years old I what?
[quote user="mtanzer"]This is a workaround.[/QUOTE]A 'solution' in this case is what worked for the o/p, nobody said the original problem was solved.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
frss03
Posts: 1
Joined: Sat Sep 13, 2014 3:14 am

[SOLVED] Backup / Restore with tgz formatter

Post by frss03 »

[quote user="10330phoenix"]..... and the point of adding this to a thread that's almost four years old I what?
A 'solution' in this case is what worked for the o/p, nobody said the original problem was solved.[/QUOTE]


I understand that it is a closed message, but it had not solution until this time.
I solved this issue replacing the & (ampersand symbol) with the equivalent to URLs: %26%.
When I tested the "&" in Zimbra 6 there was not problem, but when migrate to Zimbra 8 the problem appeared.
So in any message of this forum this solution doesnt appears and this is my contribution.
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL “//?fmt=tgz%26%resolve=reset” /tmp/account.tgz
maschimidt
Advanced member
Advanced member
Posts: 67
Joined: Sat Sep 13, 2014 12:11 am

[SOLVED] Backup / Restore with tgz formatter

Post by maschimidt »

[quote user="frss03"]I understand that it is a closed message, but it had not solution until this time.
I solved this issue replacing the & (ampersand symbol) with the equivalent to URLs: %26%.
When I tested the "&" in Zimbra 6 there was not problem, but when migrate to Zimbra 8 the problem appeared.
So in any message of this forum this solution doesnt appears and this is my contribution.
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL “//?fmt=tgz%26%resolve=reset” /tmp/account.tgz[/QUOTE]
Hi in my case after replacing the & for %26% error changed


/opt/zimbra/bin/zmmailbox -z -m space@mydomain postRestURL "//?fmt=tgz%26%resolve=reset" /root/prg/space@mydomain

ERROR: service.FAILURE (system failure: POST failed, status=400 error parsing message)
Thanks for help..
7531prashant
Outstanding Member
Outstanding Member
Posts: 343
Joined: Fri Sep 12, 2014 10:39 pm

[SOLVED] Backup / Restore with tgz formatter

Post by 7531prashant »

zmztozmig can also be used for zimbra to zimbra migration.
zimbra@zcs147:~$ /opt/zimbra/libexec/zmztozmig -h

usage:

*********************

zmztozmig -[options]

Options details:

-v --version Prints version

-h --help Shows help

-f --ConfigFile Config file path

[default file -> /opt/zimbra/conf/zmztozmig.conf ]

-d --debug prints versbose debug messages
hisfran
Posts: 31
Joined: Tue Apr 29, 2014 2:10 pm

Re: [SOLVED] Backup / Restore with tgz formatter

Post by hisfran »

The correct syntax is at: https://wiki.zimbra.com/wiki/Ajcody-Mig ... fter_Dates
This worked for me to export from an old Zimra 7 server.

Code: Select all

 zmmailbox -z -m user@`zmhostname` gru '/?fmt=tgz&query=after:"10/01/14" and before:"10/15/14"' > /tmp/filename.tgz
Post Reply