Download all documents within a site/folder along with metadata information

cancel
Showing results for 
Search instead for 
Did you mean: 
kartech11
Active Member II

Download all documents within a site/folder along with metadata information

Hi,

I currently have an alfresco production instance on which I have setup my content model, sites and folders using the Share UI. 

I now am looking to bootstrap all the above and I gather that if the content model has been setup in Model Manager via the Share UI, implementing a bootstrap version of the model would not be handled well by alfresco when it starts up. 

I have about 300 -400 documents uploaded on to my production instance. 

1. I plan to locate and download the documents using the search REST API in alfresco. I would also like to get the metadata for the documents (I have aspects associated to the documents) and also store the folders where the documents were located initially. I plan to keep all of this in a temporary database somewhere

2. I plan on installing a fresh version of alfresco and then apply my bootstrap on it

3. I then plan on using the alfresco upload REST APIs to upload the documents and metadata

Queries

a.Should I use CMIS for download from old instance and REST APIs to upload the documents to a new instance?

b. I actually want to get all the documents within a folder along with its metadata. Are there any recommended REST APIs I can use to get the list of documents and its metadata?

c. Is there any better approach to download all folders and files within a site and then upload it back to another alfresco instance. This might save me going through the above approach and create the documents using some tool that alfresco allowes that I am not aware of at the minute.

d. With downloading and uploading documents using REST API approach, I plan on discarding the node Ids for the documents

e.Please let me know if the above approach has any issues or would affect alfresco search capabilities?

f. Would using CIMS be easier for this to extract document content and metadata information and storing it in temp database and then migrating them using my custom REST API. It would then index the documents as well.

4 Replies
jpotts
Professional

Re: Download all documents within a site/folder along with metadata information

If you are installing a new instance of the same version of Alfresco, and you want everything in the old instance to be in the new instance, and you are not changing databases, it is far easier to simply dump the database, tar up the content store and the database dump, then do the reverse into your new instance. Then you'll have an exact replica of the old instance without having to write any scripts.

Regarding your other questions, why would you use CMIS to download, then the REST API to upload? You can use CMIS to do both the download and the upload if you decide to go that route.

In my opinion, it is pretty easy to use CMIS to download folders, files, and metadata. If you don't use my database dump-and-load suggestion, I'd use CMIS.

cesarista
Customer

Re: Download all documents within a site/folder along with metadata information

Hi:

In addition, if you do not need your sys-uuid information, I would consider to use bulk export tool in the source:

GitHub - vprince1/alfresco-bulk-export: Automatically exported from code.google.com/p/alfresco-bulk-... 

and then to use Alfresco bulk import tool in the target with the exported data.

Regards.

--C.

kartech11
Active Member II

Re: Download all documents within a site/folder along with metadata information

Thanks Jeff Potts‌, I am actually taking a look at your example to connect via CMIS to query alfresco

alfresco-developer-series/content/content-tutorial-cmis at master · jpotts/alfresco-developer-series... 

Is there any tutorial you have that will give me some guidance to do a quick sample so that I can get comfortable with CMIS to query alfresco? I am hoping with CMIS I can run it in a standalone java class to query my alfresco instance for sites, folders , document content and metadata information.

jpotts
Professional

Re: Download all documents within a site/folder along with metadata information

The text that goes along with that code is:

Working With Custom Content Types in Alfresco | ECMArchitect | Alfresco Developer Tutorials 

In addition, the Chemistry web site has many code examples:

Home - Apache Chemistry Samples