Transering data without root access

cancel
Showing results for 
Search instead for 
Did you mean: 
upforsin
Senior Member

Transering data without root access

Hello,

Let's say I'm a site manager (I have access to all files within the site). Can I transfer all site's files including permissions and folder structures to another Alfresco server, which I'm the owner?

howkymike
Alfresco Developer
2 Replies
afaust
Master

Re: Transering data without root access

Yes, but it depends either on the configuration of your system or your ability to craft some custom web script / URL calls. Every Alfresco installation has a default action called "export" which can be called by any user. This action can create a downloadable ZIP-like file (ACP = Alfresco Content Package), which can - with potentially no or only minor adaptions - be imported into another Alfresco system using a similar "import" action.

Unfortunately, a default Alfresco installation does not provide a UI action to trigger either the "export" nor "import" actions. So unless your system has been configured with some customisations, e.g. by adding a 3rd-party module to provide access to those actions or having some custom configuration to enable this, you are forced to craft web script calls using any kind of HTTP / ReST client (e.g. cURL). Such a call essentially needs to "fake" the submission of a form for the action, including the necessary action parameters as specially prepared form parameters.

The relevant web scripts are https://github.com/Alfresco/alfresco-remote-api/blob/master/src/main/resources/alfresco/templates/we... (for submitting the form) and https://github.com/Alfresco/alfresco-remote-api/blob/master/src/main/resources/alfresco/templates/we... (for retrieving a structured definition of the form for a specific item / action). The "item kind" will be "action", while the "item ID" will be the name of the action, e.g. "export" / "import". The form definition will list the supported parameters. Form data can be submitted in JSON format, where the "dataKey" of fields should be used to reference the corresponding parameter values.

upforsin
Senior Member

Re: Transering data without root access

Thank you for your reply. Unfortunately, my system is just a default Alfresco installation.

I tried to craft a POST requests but I do not fully understand how does this web script work.

I'm using Postman, I filled "Basic Auth" tab, and in the "body" I typed:

{
     "itemKind" : "action",
     "itemId" : "export",
     "fields" : "",
     "force" : "false"
}

Of course, I got a 500 error: 

"00060014 Wrapped Exception (with status template): 00060168 An error occurred while processing the template 'When calling macro \"formDefJSON\", required parameter \"form\" (parameter #1) was specified, but had null/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @formDefLib.formDefJSON form=form  [in template \"org/alfresco/repository/forms/formdefinition.post.json.ftl\" at line 2, column 1]'.

What should be the value of the "fields" parameter? How can I specify which site should it export?

howkymike
Alfresco Developer