email restore issue...
 
Notifications
Clear all

email restore issue with zmmailbox command

11 Posts
5 Users
4 Reactions
1,983 Views
(@maxin)
Joined: 2 years ago
Posts: 16
Topic starter  

Hi,

When I try to restore email with the following command I get a connection refused issue.

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

zextras@carbonio:~/backup_migration$
zextras@carbonio:~/backup_migration$ zmmailbox -z -v -t 2147483 -m user@domain.tld postRestURL "//?fmt=tgz&resolve=skip" data/user@domain.tld.tgz ;
ERROR: zclient.IO_ERROR (Connection refused) (cause: java.net.ConnectException Connection refused)
com.zimbra.common.zclient.ZClientException: Connection refused
ExceptionId:main:1667989053346:0b19b171c088edc0
Code:zclient.IO_ERROR
at com.zimbra.common.zclient.ZClientException.IO_ERROR(ZClientException.java:37)
at com.zimbra.client.ZMailbox.postRESTResource(ZMailbox.java:4000)
at com.zimbra.cs.zclient.ZMailboxUtil.doPostRestURL(ZMailboxUtil.java:3024)
at com.zimbra.cs.zclient.ZMailboxUtil.execute(ZMailboxUtil.java:1301)
at com.zimbra.cs.zclient.ZMailboxUtil.main(ZMailboxUtil.java:2905)
Caused by: java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:493)
at java.base/sun.nio.ch.Net.connect(Net.java:482)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:339)
at java.base/java.net.Socket.connect(Socket.java:603)
at java.base/java.net.Socket.connect(Socket.java:552)
at java.base/java.net.Socket.<init>(Socket.java:475)
at java.base/java.net.Socket.<init>(Socket.java:249)
at java.base/javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:271)
at com.zimbra.common.net.ProtocolSocketFactoryWrapper.createSocketFromHostInfo(ProtocolSocketFactoryWrapper.java:84)
at com.zimbra.common.net.ProtocolSocketFactoryWrapper.createSocket(ProtocolSocketFactoryWrapper.java:39)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:119)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at com.zimbra.common.httpclient.HttpClientUtil.executeMethod(HttpClientUtil.java:62)
at com.zimbra.common.httpclient.HttpClientUtil.executeMethod(HttpClientUtil.java:39)
at com.zimbra.client.ZMailbox.postRESTResource(ZMailbox.java:3990)
... 3 more
zextras@carbonio:~/backup_migration$

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

when checked some online docs they says it might due to the ldap but its enabled

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

zextras@carbonio:~/backup_migration$ zmlocalconfig |grep zmprov
zimbra_zmprov_default_soap_server = carbonio.domain.tld
zimbra_zmprov_default_to_ldap = true
zmprov_safeguarded_attrs = zimbraServiceEnabled,zimbraServiceInstalled
zmprov_tmp_directory = ${zimbra_tmp_directory}/zmprov
zextras@carbonio:~/backup_migration$

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

What could be the issue,? 

 

Thanks


   
Quote
mgarbo
(@mgarbo)
Joined: 10 years ago
Posts: 61
 

Hi @Maxin,

please be sure the topic has not been already dealt with somewhere else in this forum before opening a new on.

Here an old topic that can help you to solve your problem https://community.zextras.com/forum/postid/3688/


   
ReplyQuote
(@maxin)
Joined: 2 years ago
Posts: 16
Topic starter  

@mgarbo 

Hi,

its totally different issue, and nothing related to time out. also I'm trying to restore, and I'm getting connection refused not the timeout issue.

so it's a complete different issue.. 

 


   
ReplyQuote
mgarbo
(@mgarbo)
Joined: 10 years ago
Posts: 61
 

@maxin the old topic is not only related to connection timeout but it give you the correct syntax to be used for your import/export.

I suggest you to read this specific post where is specified what you need to use inside PostRest syntax:  https://community.zextras.com/forum/postid/3712/

If you have any other issue, after you used the correct syntax, please copy/paste error and i will try to help you.


   
ReplyQuote
(@sharif)
Admin
Joined: 2 years ago
Posts: 574
 
Posted by: @maxin

zextras@carbonio:~/backup_migration$ zmmailbox -z -v -t 2147483 -m user@domain.tld postRestURL "//?fmt=tgz&resolve=skip" data/user@domain.tld.tgz ; ERROR: zclient.IO_ERROR (Connection refused) (cause: java.net.ConnectException Connection refused) com.zimbra.common.zclient.ZClientException: Connection refused

@maxin

If we understand clearly, you are trying to backup/export the email account using CLI and again restore/import the data the same way, right?

If this is the scenario:

Could you please follow these steps and let us know if it helps or not:

Step-1

zmprov md sampleserver.xyz zimbraPublicServicePort 443
zmprov md sampleserver.xyz zimbraPublicServiceProtocol https
zmprov mcf zimbraPublicServiceHostname mail.sampleserver.xyz
zmmailboxdctl restart

 

Step-2

For backup/export

/opt/zextras/bin/zmmailbox -z -m zextras@sampleserver.xyz  getRestURL '/?fmt=tgz' > /tmp/zextras@sampleserver.xyz.tgz

 

Step-3

For restore/import

/opt/zextras/bin/zmmailbox -z -m zextras@sampleserver.xyz  postRestURL "/?fmt=tgz&resolve=skip"  /tmp/zextras@sampleserver.xyz.tgz

 

Let us know your observation.

Thanks and regards,
Sharif

 


   
ReplyQuote
(@maxin)
Joined: 2 years ago
Posts: 16
Topic starter  

@shariful-islam 

HI,

That fixed the issue, email is now importing.. 

thanks for the support  🙂

 

@ mgarbo

thanks for your reply to, I  fixed the timeout issue with that too 


   
ReplyQuote
(@sharif)
Admin
Joined: 2 years ago
Posts: 574
 

@maxin 

We are happy that it helped you and thanks for your trust.

But as you know in system administration, sometimes it takes time to understand and get the solution, We would request you to bear with us and be with us.

Have a good day 😊

Thanks and regards,

Sharif


   
ReplyQuote
(@maxin)
Joined: 2 years ago
Posts: 16
Topic starter  

@shariful-islam 

Thank you very much, much appreciated:)


   
ReplyQuote
(@chaithanya)
Joined: 2 years ago
Posts: 10
 

Dear Sir

ERROR: zclient.IO_ERROR (Connection refused) (cause: java.net.ConnectException Connection refused)

when I am trying to do this on the newly installed Carbonio CE Server.

su - zextras 

/opt/zextras/bin/zmmailbox -z -m chaithanya@carbonio.local postRestURL "/?fmt=tgz&resolve=skip" /tmp/chaithanya@carbonio.local.tgz

chaithanya@carbonio.local.tgz this file I am taking from the old Carbonio CE server.

Trying to restore but giving me the above error, please suggest some solution to this.


   
ReplyQuote
(@sharif)
Admin
Joined: 2 years ago
Posts: 574
 

@chaithanya 

Hi,

Could you please do these steps first and try again:

zmprov md sampleserver.xyz zimbraPublicServicePort 443
zmprov md sampleserver.xyz zimbraPublicServiceProtocol https
zmprov mcf zimbraPublicServiceHostname mail.sampleserver.xyz
zmmailboxdctl restart

 

Regards,

Sharif


   
ReplyQuote
 bluc
(@bluc)
Joined: 2 years ago
Posts: 3
 

@sharif That did the trick - thank you so much!

Is there a chance to put that into the documentation somewhere?


   
ReplyQuote