Tool to export and bootstrap data from an existing Alfresco instance to an empty and new Alfresco instance.
Presented at the Alfresco Day in Barcelona the 10th of February 2016
2. Marco Mancuso
• Currently Alfresco DevOps team
• Previously…
– Alfresco global Support team
• Advance Team
• Expert Team
• Development Support
– Developer for Italian OSS Consultancy Company (Alfresco Partner)
Aboutus
3. Aboutus
Alfresco Devops
Keep the lights on
• Public services (activiti|my.alfresco.com, Alfresco
Online Trials)
• Internal infrastructure
• Internal projects (QA, Engineering, Sales, Marketing,
...)
Automate all the things
• Mostly inspire
• Sometimes lead
• Never impose
9. What else?
• Quickly test customisations with limited set of predefined bootstrapped
data
• Collaborative approach on data definition
• Show test environments:
– Marketing
– Sales
– Partners
– …
• Needs Little or NO configuration at all!
BigQuestions
10. How does it work?
• 2 repo AMPs:
BigQuestions
• Applied to the repo in which to
export data
• Contains all the APIs to extract
data
• Applied at bootstrap time to
the repo
• Contains all the data to
bootstrap
14. What is it possible to export & bootstrap?
• Full Share Sites
• Contents in Company Home
– Models (Bootstrap)
– Virtual Folders
– Scripts
– Webscripts
– Workflows (Bootstrap)
• Models (Dynamic)
• Workflows (Dynamic)
• Authorities ( Users + People + Groups)
GeneralDetails
15. Technologies used
• Alfresco 5.1.EA
– AMP
– Java Backed WebScripts
– Patch Service
– Bootstrap Services
– ACP
• Alfresco Maven SDK 2.1.1 All In One Archetype
• Java
• Spring
• Maven
GeneralDetails
17. Export a Site
• Existing Alfresco API
• (GET) http://localhost:8080/alfresco/s/api/sites/{SITE_NAME}/export
• Admin authentication
ExportAPIs
SiteName.zip
Contents.acp
Users.acp
People.acp
Groups.txt
18. Export the authorities (1/2)
• Custom API
• (GET) http://localhost:8080/alfresco/s/api/people-groups/export
• Optional Parameters:
ExportAPIs
usersToExport users to export Default: ALL
groupsToExport groups to export Default: ALL
excludeSiteGroups TRUE/FALSE Default: False
groupsToExclude groups to exclude Default: NULL
usersToExclude users to exclude Default: NULL
30. Record Management site
• Treated as standard site
• Problem:
– ACP does not handle well d:any objects:
– rma:readers (type d:any)
– rma:writers (type d:any)
• Solution:
– RMSitePatch: find nodes and convert properties values from String to Map
AMPstructure
33. (Model Manager) Content Models
• Alfresco already provides a way to export/import them
• Folders not visible from Share NodeBrowser
• Path: /app:company_home/app:dictionary/app:models
AMPstructure
35. So… Where are the configurations?
• (Generally) No configuration is required
• Beans dynamically generated with:
– org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
• Resources dynamically found with:
– org.springframework.core.io.support.PathMatchingResourcePatternResolver
TechnicalDetails
37. Order really matters!
Dynamic order to bootstrap content:
1. Company Home
2. Models
3. Workflows
4. Sites (on Context Refresh)
5. Authorities (on Context Refresh)
TechnicalDetails
40. How to run the SDK
1. git clone git@github.com:maoo/alfresco-demo-data.git
2. cd alfresco-demo-data
3. ./run.sh
4. Go to http://localhost:8080/share
Let’srunit!
41. How to create the bootstrap AMP
1. git clone git@github.com:maoo/alfresco-demo-data.git
2. cd /alfresco-demo-data/alfresco-demo-data-repo-amp
3. mvn package –DskipTests=true
4. AMP in /alfresco-demo-data/alfresco-demo-data-repo-amp/target
Let’srunit!
42. How to create the export AMP
1. git clone git@github.com:maoo/alfresco-demo-data.git
2. cd /alfresco-demo-data/alfresco-demo-data-exporter-repo-amp
3. mvn package –DskipTests=true
4. AMP in /alfresco-demo-data/alfresco-demo-data-exporter-repo-amp/target
Let’srunit!
43. ACP Limitations
• Document categories and tags
• Content models with d:any properties
• Node versions
• Secondary parents
• ACP export/import can only be used between same versions
Limitations