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 09-15-2011, 05:48 PM
Senior Member
 
Posts: 68
Default Restoring mailbox using zmmailbox PostResURL

I made a backup of a mailbox using:
mmailbox -z -m user@domain.com getRestURL -o backup.tgz “//?fmt=tgz”

then, created a test accound on the same domain and tried to restore the backup file.:

zmmailbox -z -m test@domain.com postRestURL "//?fmt=tgz&resolve=reset" backup.tgz


but im getting this error:

ERROR: service.FAILURE (system failure: POST failed, status=302 Found)

Im using: zcs-7.1.1_GA_3196.UBUNTU8_64 Community


thanks!
Reply With Quote
  #2 (permalink)  
Old 09-16-2011, 04:37 AM
Elite Member
 
Posts: 305
Default

Quote:
zmmailbox -z -m test@domain.com postRestURL "//?fmt=tgz&resolve=reset" backup.tgz
Specify the complete path to the backup.tgz

Code:
zmmailbox -z -m $NAME postRestURL '//?fmt=tgz&resolve=reset' $DIR/$NAME.tgz
Doug
__________________
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Reply With Quote
  #3 (permalink)  
Old 09-16-2011, 05:41 PM
Senior Member
 
Posts: 68
Default

i specified the absolute path and got the same error.

the name of the account need to be the same of the file backed up? $NAME
Reply With Quote
  #4 (permalink)  
Old 09-17-2011, 12:23 PM
Elite Member
 
Posts: 305
Default

No, not that I'm aware of. Try using the Zimbra web portal to import it and see if it works there.

Doug
__________________
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Reply With Quote
  #5 (permalink)  
Old 09-19-2011, 04:57 PM
Senior Member
 
Posts: 68
Default

importing from web Works!
Reply With Quote
  #6 (permalink)  
Old 10-21-2011, 02:30 AM
Member
 
Posts: 13
Default

Hello,

I've got a similar issue :
I'm trying to restore a 3.6 GB backup on CLI, and it doesnt work.

Here is what I tried :

Quote:
/opt/zimbra/bin/zmmailbox -z --url https://MY.SERVER.COM:7071 -m ACCOUNT@DOMAIN.COM postRestURL "//?fmt=tgz&resolve=skip" /tmp/Backup-2011-10-17-112018.tgz
Replacing :
- "MY.SERVER.COM" with FQDN of the zimbra server
- "ACCOUNT@DOMAIN.COM" with target customer email account

And here hese the result (returned after a few seconds) :

Quote:
ERROR: service.FAILURE (system failure: POST failed, status=302 Found)
Same things occure when removing "--url https://MY.SERVER.COM:7071" :

Quote:
/opt/zimbra/bin/zmmailbox -z -m ACCOUNT@DOMAIN.COM postRestURL "//?fmt=tgz&resolve=skip" /tmp/Backup-2011-10-17-112018.tgz
Is this a problem with my config only accepting HTTPS ?
or because of the 3.6GB size of the backup ?
I don't think I can post a 3.6GB file on the web portal...
Reply With Quote
  #7 (permalink)  
Old 10-21-2011, 02:49 AM
Member
 
Posts: 13
Default

And here is the "verbose" answer, with "-v" switch :

Quote:
ERROR: service.FAILURE (system failure: POST failed, status=302 Found)
com.zimbra.common.service.ServiceException: system failure: POST failed, status=302 Found
ExceptionId:main:1319189836614:db6623fa714bb918
Code:service.FAILURE
at com.zimbra.common.service.ServiceException.FAILURE (ServiceException.java:248)
at com.zimbra.cs.zclient.ZMailbox.postRESTResource(ZM ailbox.java:2496)
at com.zimbra.cs.zclient.ZMailboxUtil.doPostRestURL(Z MailboxUtil.java:2798)
at com.zimbra.cs.zclient.ZMailboxUtil.execute(ZMailbo xUtil.java:1141)
at com.zimbra.cs.zclient.ZMailboxUtil.main(ZMailboxUt il.java:2679)
[EDIT]

The same error appear when importing on CLI a small export of 5 MB...
(this same 5MB export can be imported succesfully via the webmail)

It's a Zimbra Network Edition : Zimbra 7.1.2_GA_3268 (version 20110804120420)

Any help would be greatly appreciated.

Last edited by michelp; 10-21-2011 at 08:33 AM..
Reply With Quote
  #8 (permalink)  
Old 10-24-2011, 08:37 AM
Member
 
Posts: 13
Default postRestURL returning "system failure: POST failed, status=302 Found"

I've found a workaround to make it work :

The issue I encountered comes from a special config I use :
Code:
zmtlsctl redirect
(i.e. webmail http force redirect to httpS, only httpS allowed)
instead of the default Zimbra config :
Code:
zmtlsctl both
(i.e. both http and httpS fully works for webmail)

With "zmtlsctl redirect" used, a "/opt/zimbra/bin/zmmailbox -z -m user@host postRestURL (...)" command won't work and returns this weird error :
Code:
ERROR: service.FAILURE (system failure: POST failed, status=302 Found)
So the workaround consist of temporarly allowing http with "zmtlsctl both" :
Code:
su - zimbra
zmtlsctl both
zmmailboxdctl restart
...then, importing mailbox :
Code:
/opt/zimbra/bin/zmmailbox -z -m user@host postRestURL (...)
... then finally getting back to my previous config :
Code:
su - zimbra
zmtlsctl redirect
zmmailboxdctl restart
Maybe there is another / better way of doing it,
but this one works !
Reply With Quote
  #9 (permalink)  
Old 10-24-2011, 08:49 AM
Member
 
Posts: 13
Default A more simple way of doing it

In fact, when using :
Code:
zmtlsctl redirect
there is no need to reconfigure Zimbra to correctly import mailbox via CLI.

Only thing to use is :
adding "-u" param with correct httpS host-path,
and putting "-u" AFTER "postRestURL" (not before as I use to do)
Example :
Code:
/opt/zimbra/bin/zmmailbox -z -m user@host postRestURL -u https://HOST "//?fmt=tgz&resolve=skip" /tmp/export.tgz
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.