Export and Import

Document created by resplin Employee on Jun 6, 2015Last modified by alfresco-archivist on Aug 31, 2016
Version 2Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



ImportExport


Introduction


Alfresco provides the capability to export information held in its Repository and then subsequently import that information into either the same or another Repository. 
If a Repository can store it, a Repository can export and import it.

Export and Import is useful for:


  • Bulk extract and load of personal or team information from one location to another
  • Integration with 3rd party systems

Warning


  1. You can only perform an import/export between compatible versions of Alfresco, which generally means the same version.
  2. Import/Export is not recommended to perform an upgrade (Versions 2.x-3.x).
  3. Backup and restore (personal, team or complete Repository scope) is not currently recommended.



The process for export and import is simple.

1) Export produces one or more ACP (Alfresco Content Package) files which hold the exported information.  As with all files, you can place them somewhere secure,
or transfer them using transports such as e-mail, ftp etc.  The scope of information
to export is configurable, but typically involves specifying the location within
the Repository to export.  Due to the hierarchical nature of the Repository every
item within that location is taken e.g. exporting folder 'My Documents' will export
the folder, its contents, and all sub-folders.  Security settings only allow export
of those items which are readable by the user performing the export.

2) Import of an ACP file is the reverse of an export.  The information held in the
ACP file is placed into the Repository location chosen at import time.  By default,
the import process creates a copy of the ACP held information, although, other
forms of import can take place such as 'update information, if it already exists'.

The format of an ACP file is described in detail later in this document, but it
should be noted that any process or tool may generate one, which is very useful
to system to system integration.


Web Client Export & Import of Folders & Files


Any user of Alfresco may perform an export and import of folders and files
they have access to.

The process for export of a Folder within the Web Client is:


  1. Select Space to export
  2. Select More Actions -> View Details
  3. Select Export Action to launch Export Dialog
  4. Fill in export options
    1. Package name - name of the resulting export ACP file
    2. Destination - the location within the Repository to place the ACP file
    3. Include children - if selected, will also export sub-folders
    4. Include self - if selected, exports the selected folder, otherwise only export the children
    5. Run in background - if selected, the export will take place in the background eventually creating export ACP file
    6. Select Ok

On success, the destination location will contain the ACP file.  At this point the ACP file can be
saved to a local file system for safe backup or transfer via e-mail.

The process for importing an ACP file within the Web Client is:


  1. Select Space to import information into
  2. Select More Actions -> View Details
  3. Select Import Action to launch Import Dialog
  4. Fill in export options
    1. Location - select ACP file to import from file system
    2. Select Upload
    3. Run in background - if selected, the import will take place in the background eventually creating all folders and files held in the ACP file
    4. Select Ok

On success, the information exported and held in the ACP file will now reside in the destination Space.


Import Action


Using Alfresco Rules and Actions it is possible to setup an automated import whereby an ACP file is automatically imported into the Repository when placed into a designated Repository folder (or Space).

For example, the following Rule is defined against an 'Import' folder which has a condition of '*.acp' and if met, has an action to Import the ACP into the 'Dave's Space' folder.

Importrule.jpg

When an ACP file is placed into the 'Import' folder it automatically kicks off the Import process and places the items held in the ACP file into the 'Dave's Space' folder.

The important point to remember, is that the Import will be initiated regardless of how the ACP file was placed into the folder.  For example, the Import will initiate if the ACP file was placed there via CIFS, FTP, WebDAV, Web Client or API.  This is particularly powerful for system to system data integration.






Export & Import Command Line Tools


Alfresco Export and Import Tools are developed directly
against the Alfresco Repository Foundation APIs. This means they execute stand-alone with 
an embedded Repository. To perform an Export and Import via these tools requires configuration of the   
Repository to ensure the appropriate storage locations (e.g. database and file system directory) are used.


Before Running


Please ensure that the Alfresco database is listening before attempting to invoke any of these tools. If you installed Alfresco using an integrated installer you may find that your database is started by your alf_start script and shut down by your alf_stop script. If this is the case you should start mysqld manually without Alfresco. For example, on Windows:

set ALF_HOME=C:\Alfresco
start 'MySQL' '%ALF_HOME%mysql\bin\mysqld' --defaults-file='%ALF_HOME%mysql\my.ini' --basedir='%ALF_HOME%mysql' --console

Example Commands


Note: On Windows, Alfresco 3.1 build 1526 (final), run this from TOMCAT\webapps\alfresco\WEB-INF directory.



java.exe -classpath classes\alfresco\module;..\..\..\shared\classes;classes;lib\abdera-core-0.4.0-incubating.jar;lib\abdera-extensions-json-0.4.0-incubating.jar;lib\abdera-i18n-0.4.0-incubating.jar;lib\abdera-parser-0.4.0-incubating.jar;lib\acegi-security-0.8.2_patched.jar;lib\activation.jar;lib\addressing-1.0.jar;lib\alfresco-core.jar;lib\alfresco-deployment.jar;lib\alfresco-jlan-embed.jar;lib\alfresco-linkvalidation.jar;lib\alfresco-mbeans.jar;lib\alfresco-remote-api.jar;lib\alfresco-repository.jar;lib\alfresco-web-client.jar;lib\alfresco-webscript-framework.jar;lib\ant.jar;lib\antlr-2.7.5H3.jar;lib\antlr-3.1b1.jar;lib\aopalliance.jar;lib\avalon-framework-4.2.0.jar;lib\axiom-api-1.2.5.jar;lib\axiom-impl-1.2.5.jar;lib\axis-1.4.jar;lib\batik-all-1.6.jar;lib\bcel.jar;lib\bcmail-jdk15-137.jar;lib\bcprov-jdk15-137.jar;lib\bliki-3.0.2.jar;lib\bsf-2.4.0.jar;lib\bsh-1.3.0.jar;lib\catalina.jar;lib\cglib-nodep-2.2_beta1.jar;lib\chiba-1.3.0.jar;lib\commons-beanutils-1.7.0.jar;lib\commons-codec-1.3.jar;lib\commons-collections-3.1.jar;lib\commons-dbcp-1.2.1.jar;lib\commons-digester-1.6.jar;lib\commons-discovery-0.2.jar;lib\commons-el.jar;lib\commons-fileupload-1.1.1.jar;lib\commons-httpclient-3.1.jar;lib\commons-io-1.1.jar;lib\commons-jxpath-1.2.jar;lib\commons-lang-2.1.jar;lib\commons-logging-1.1.jar;lib\commons-modeler.jar;lib\commons-pool-1.4.jar;lib\commons-validator.jar;lib\cxf-2.1.2.jar;lib\derby.jar;lib\dom4j-1.6.1.jar;lib\ehcache-1.4.1-patched.jar;lib\facebook_070716.jar;lib\FastInfoset-1.2.2.jar;lib\fontbox-0.1.0.jar;lib\fop-0.94.jar;lib\freemarker-2.3.13.jar;lib\geronimo-activation_1.0.2_spec-1.1.jar;lib\geronimo-activation_1.1_spec-1.0.2.jar;lib\geronimo-annotation_1.0_spec-1.1.1.jar;lib\geronimo-jaxws_2.1_spec-1.0.jar;lib\geronimo-stax-api_1.0_spec-1.0.1.jar;lib\geronimo-ws-metadata_2.0_spec-1.1.2.jar;lib\guessencoding-1.0.jar;lib\hibernate-3.2.6-patched.jar;lib\hrtlib.jar;lib\hsqldb.jar;lib\htmlparser-1.6.jar;lib\ibatis-2.3.0.677.jar;lib\icu4j_3_6_1.jar;lib\jakarta-oro-2.0.8.jar;lib\jaxb-api-2.1.jar;lib\jaxb-impl-2.1.7.jar;lib\jaxb-xjc-2.1.7.jar;lib\jaxen-1.1-beta-8.jar;lib\jaxrpc.jar;lib\jaxws-api-2.0.jar;lib\jbpm-identity-3.2.2.jar;lib\jbpm-jpdl-3.2.2.jar;lib\jcr-1.0.jar;lib\jgroups-2.6.2.jar;lib\jibx-bind.jar;lib\jibx-run.jar;lib\jid3lib-0.5.jar;lib\JMagick.jar;lib\joda-time-1.2.1.jar;lib\jooconverter-2.1.0.jar;lib\json.jar;lib\jsr107cache-1.0.jar;lib\jstl-1.1.0.jar;lib\jta.jar;lib\jug-lgpl-2.0.0.jar;lib\junit.jar;lib\jut.jar;lib\log4j-1.2.15.jar;lib\lucene-analyzers-2.1.0.jar;lib\lucene-core-2.1.0.jar;lib\lucene-snowball-2.1.0.jar;lib\mail.jar;lib\myfaces-api-1.1.5.jar;lib\myfaces-impl-1.1.5.jar;lib\mysql-connector-java-5.0.3.jar;lib\naming-factory.jar;lib\naming-resources.jar;lib\neethi-2.0.4.jar;lib\odf_utils.jar;lib\odmg-3.0.jar;lib\openoffice-juh-2.0.3.jar;lib\openoffice-jurt-2.0.3.jar;lib\openoffice-ridl-2.0.3.jar;lib\openoffice-sandbox-2.0.3.jar;lib\openoffice-unoil-2.0.3.jar;lib\opensaml-1.0.1.jar;lib\pdfbox-0.7.3.jar;lib\PDFRenderer.jar;lib\poi-3.1.jar;lib\portlet-api-lib.jar;lib\proof-june2009-1.0.0.jar;lib\quartz-1.6.0.jar;lib\resolver.jar;lib\rhino-js-1.6R7.jar;lib\saaj-api-1.3.jar;lib\saaj-impl-1.3.jar;lib\saaj.jar;lib\saxpath.jar;lib\shale-test-1.0.4.jar;lib\spring-2.0.6.jar;lib\springmodules-jbpm31.jar;lib\standard.jar;lib\stax-api-1.0.1.jar;lib\stax-utils-20060502.jar;lib\subetha-smtp.jar;lib\tm-extractors-1.0.jar;lib\tomcat-coyote.jar;lib\tomcat-util.jar;lib\truezip.jar;lib\wsdl4j-1.6.2.jar;lib\wss4j.jar;lib\wstx-asl-3.2.1.jar;lib\wstx-asl-3.2.4.jar;lib\xercesImpl-2.8.0.jar;lib\xml-apis.jar;lib\xml-resolver-1.2.jar;lib\xmlgraphics-commons-1.2.jar;lib\xmlrpc.jar;lib\XmlSchema-1.4.2.jar;lib\xmlsec-1.4.1.jar;lib\xpp3-1.1.3_8.jar;lib\xstream-1.1.3.jar;..\..\..\endorsed\serializer.jar;..\..\..\endorsed\xalan.jar org.alfresco.tools.Export -user admin -pwd admin -store user://alfrescoUserStore -verbose users.acp

Note: On Windows (running Java6), save the lines below in a .cmd file, and run this from TOMCAT\webapps\alfresco\WEB-INF directory.



set CPATH=../../../lib/*;../../../endorsed/*;lib/*;classes;../../../shared/classes;
java.exe -Xms128m -Xmx512m -Xss96k -XX:MaxPermSize=160m -classpath %CPATH% org.alfresco.tools.Export -user admin -pwd admin -store user://alfrescoUserStore -verbose users.acp

Note: On Windows, Alfresco 2.1, run this from TOMCAT\webapps\alfresco\WEB-INF directory.  




java.exe -classpath classes\alfresco\module;..\..\..\shared\classes;classes;lib\acegi-security-0.8.2_patched.jar;lib\activation.jar;lib\addressing-1.0.jar;lib\alfresco-core.jar;lib\alfresco-deployment.jar;lib\alfresco-linkvalidation.jar;lib\alfresco-mbeans.jar;lib\alfresco-remote-api.jar;lib\alfresco-repository.jar;lib\alfresco-web-client.jar;lib\ant.jar;lib\antlr-2.7.5H3.jar;lib\aopalliance.jar;lib\avalon-framework-4.2.0.jar;lib\bcel.jar;lib\bcprov-jdk15-137.jar;lib\bsf-2.4.0.jar;lib\bsh-1.3.0.jar;lib\catalina.jar;lib\cglib-nodep-2.2_beta1.jar;lib\chiba-1.3.0.jar;lib\commons-beanutils-1.7.0.jar;lib\commons-codec-1.3.jar;lib\commons-collections-3.1.jar;lib\commons-dbcp-1.2.1.jar;lib\commons-digester-1.6.jar;lib\commons-discovery-0.2.jar;lib\commons-el.jar;lib\commons-fileupload-1.1.1.jar;lib\commons-httpclient-3.0.jar;lib\commons-io-1.1.jar;lib\commons-jxpath-1.2.jar;lib\commons-lang-2.1.jar;lib\commons-logging-1.0.4.jar;lib\commons-modeler.jar;lib\commons-pool-1.3.jar;lib\commons-validator.jar;lib\cpool.jar;lib\cryptix-jce-provider.jar;lib\dom4j-1.6.1.jar;lib\ehcache-1.3.0-patched.jar;lib\fontbox-0.1.0.jar;lib\fop-0.92beta.jar;lib\freemarker.jar;lib\guessencoding-1.0.jar;lib\hibernate-3.2.1.jar;lib\hrtlib.jar;lib\hsqldb.jar;lib\htmlparser-1.6.jar;lib\icu4j_3_6_1.jar;lib\jakarta-oro-2.0.8.jar;lib\jaxen-1.1-beta-8.jar;lib\jaxrpc.jar;lib\jbpm-identity-3.2.jar;lib\jbpm-jpdl-3.2-patched.jar;lib\jcr-1.0.jar;lib\jgroups-2.2.8.jar;lib\jibx-bind.jar;lib\jibx-run.jar;lib\jid3lib-0.5.jar;lib\JMagick.jar;lib\joda-time-1.2.1.jar;lib\jooconverter-2.1.0.jar;lib\json.jar;lib\jstl-1.1.0.jar;lib\jta.jar;lib\jug-lgpl-2.0.0.jar;lib\jut.jar;lib\log4j-1.2.8.jar;lib\lucene-analyzers-2.1.0.jar;lib\lucene-core-2.1.0.jar;lib\lucene-snowball-2.1.0.jar;lib\mail.jar;lib\myfaces-api-1.1.5.jar;lib\myfaces-impl-1.1.5.jar;lib\naming-factory.jar;lib\naming-resources.jar;lib\odf_utils.jar;lib\odmg-3.0.jar;lib\openoffice-juh-2.0.3.jar;lib\openoffice-jurt-2.0.3.jar;lib\openoffice-ridl-2.0.3.jar;lib\openoffice-sandbox-2.0.3.jar;lib\openoffice-unoil-2.0.3.jar;lib\opensaml-1.0.1.jar;lib\pdfbox-0.7.3.jar;lib\poi-2.5.1_patched.jar;lib\portlet-api-lib.jar;lib\quartz-1.6.0.jar;lib\resolver.jar;lib\rhino-js-1.6R4.jar;lib\saaj.jar;lib\saxpath.jar;lib\spring-2.0.2.jar;lib\springmodules-jbpm31.jar;lib\standard.jar;lib\tlc124.jar;lib\tm-extractors-0.4_patched.jar;lib\tomcat-coyote.jar;lib\tomcat-util.jar;lib\truezip.jar;lib\wsdl4j-1.5.1.jar;lib\wss4j.jar;lib\xercesImpl-2.8.0.jar;lib\xml-apis.jar;lib\xmlgraphics-commons-1.0.jar;lib\xmlsec-1.4.0.jar;lib\xpp3-1.1.3_8.jar;lib\xstream-1.1.3.jar;..\..\..\common\lib\mysql-connector-java-5.0.3-bin.jar;..\..\..\common\endorsed\serializer.jar;..\..\..\common\endorsed\xalan.jar;lib\axis-1.4.jar;lib\jug.jar org.alfresco.tools.Export -user admin -pwd admin -store user://alfrescoUserStore -verbose users.acp




Note: On Linux Fedora, Alfresco 2.1, run this from TOMCAT/webapps/alfresco/WEB-INF directory.  




java -classpath classes/alfresco/module:../../../shared/classes:classes:lib/acegi-security-0.8.2_patched.jar:lib/activation.jar:lib/addressing-1.0.jar:lib/alfresco-core.jar:lib/alfresco-deployment.jar:lib/alfresco-linkvalidation.jar:lib/alfresco-mbeans.jar:lib/alfresco-remote-api.jar:lib/alfresco-repository.jar:lib/alfresco-web-client.jar:lib/ant.jar:lib/antlr-2.7.5H3.jar:lib/aopalliance.jar:lib/avalon-framework-4.2.0.jar:lib/bcel.jar:lib/bcprov-jdk15-137.jar:lib/bsf-2.4.0.jar:lib/bsh-1.3.0.jar:lib/catalina.jar:lib/cglib-nodep-2.2_beta1.jar:lib/chiba-1.3.0.jar:lib/commons-beanutils-1.7.0.jar:lib/commons-codec-1.3.jar:lib/commons-collections-3.1.jar:lib/commons-dbcp-1.2.1.jar:lib/commons-digester-1.6.jar:lib/commons-discovery-0.2.jar:lib/commons-el.jar:lib/commons-fileupload-1.1.1.jar:lib/commons-httpclient-3.0.jar:lib/commons-io-1.1.jar:lib/commons-jxpath-1.2.jar:lib/commons-lang-2.1.jar:lib/commons-logging-1.0.4.jar:lib/commons-modeler.jar:lib/commons-pool-1.3.jar:lib/commons-validator.jar:lib/cpool.jar:lib/cryptix-jce-provider.jar:lib/dom4j-1.6.1.jar:lib/ehcache-1.3.0.jar:lib/fontbox-0.1.0.jar:lib/fop-0.92beta.jar:lib/freemarker.jar:lib/guessencoding-1.0.jar:lib/hibernate-3.2.1.jar:lib/hrtlib.jar:lib/hsqldb.jar:lib/htmlparser-1.6.jar:lib/icu4j_3_6_1.jar:lib/jakarta-oro-2.0.8.jar:lib/jaxen-1.1-beta-8.jar:lib/jaxrpc.jar:lib/jbpm-identity-3.2.jar:lib/jbpm-jpdl-3.2-patched.jar:lib/jcr-1.0.jar:lib/jgroups-2.2.8.jar:lib/jibx-bind.jar:lib/jibx-run.jar:lib/jid3lib-0.5.jar:lib/JMagick.jar:lib/joda-time-1.2.1.jar:lib/jooconverter-2.1.0.jar:lib/json.jar:lib/jstl-1.1.0.jar:lib/jta.jar:lib/jug.jar:lib/jut.jar:lib/log4j-1.2.8.jar:lib/lucene-analyzers-2.1.0.jar:lib/lucene-core-2.1.0.jar:lib/lucene-snowball-2.1.0.jar:lib/mail.jar:lib/myfaces-api-1.1.5.jar:lib/myfaces-impl-1.1.5.jar:lib/naming-factory.jar:lib/naming-resources.jar:lib/odf_utils.jar:lib/odmg-3.0.jar:lib/openoffice-juh-2.0.3.jar:lib/openoffice-jurt-2.0.3.jar:lib/openoffice-ridl-2.0.3.jar:lib/openoffice-sandbox-2.0.3.jar:lib/openoffice-unoil-2.0.3.jar:lib/opensaml-1.0.1.jar:lib/pdfbox-0.7.3.jar:lib/poi-2.5.1_patched.jar:lib/portlet-api-lib.jar:lib/quartz-1.6.0.jar:lib/resolver.jar:lib/rhino-js-1.6R4.jar:lib/saaj.jar:lib/saxpath.jar:lib/spring-2.0.2.jar:lib/springmodules-jbpm31.jar:lib/standard.jar:lib/tlc124.jar:lib/tm-extractors-0.4_patched.jar:lib/tomcat-coyote.jar:lib/tomcat-util.jar:lib/truezip.jar:lib/wsdl4j-1.5.1.jar:lib/wss4j.jar:lib/xercesImpl-2.8.0.jar:lib/xml-apis.jar:lib/xmlgraphics-commons-1.0.jar:lib/xmlsec-1.4.0.jar:lib/xpp3-1.1.3_8.jar:lib/xstream-1.1.3.jar:../../../common/lib/mysql-connector-java-5.0.3-bin.jar:../../../common/endorsed/serializer.jar:../../../common/endorsed/xalan.jar:lib/axis-1.4.jar org.alfresco.tools.Export -user admin -pwd admin -store user://alfrescoUserStore -verbose users.acp


Note: On Ubuntu Linux, Alfresco 3.3.1 Enterprise, run this from TOMCAT/webapps/alfresco/WEB-INF directory.




java -classpath classes/alfresco/module:../../../shared/classes:classes:lib/acegi-security-0.8.2_patched.jar:lib/activation.jar:lib/addressing-1.0.jar:lib/alfresco-core.jar:lib/alfresco-deployment.jar:lib/alfresco-linkvalidation.jar:lib/alfresco-mbeans.jar:lib/alfresco-remote-api.jar:lib/alfresco-repository.jar:lib/alfresco-web-client.jar:lib/ant.jar:lib/antlr-2.7.5H3.jar:lib/aopalliance.jar:lib/avalon-framework-4.2.0.jar:lib/bcel.jar:lib/bcprov-jdk15-137.jar:lib/bsf-2.4.0.jar:lib/bsh-1.3.0.jar:lib/catalina.jar:lib/cglib-nodep-2.2_beta1.jar:lib/chiba-1.3.0.jar:lib/commons-beanutils-1.7.0.jar:lib/commons-codec-1.3.jar:lib/commons-collections-3.1.jar:lib/commons-dbcp-1.2.1.jar:lib/commons-digester-1.6.jar:lib/commons-discovery-0.2.jar:lib/commons-el.jar:lib/commons-fileupload-1.1.1.jar:lib/commons-httpclient-3.0.jar:lib/commons-io-1.1.jar:lib/commons-jxpath-1.2.jar:lib/commons-lang-2.1.jar:lib/commons-logging-1.0.4.jar:lib/commons-modeler.jar:lib/commons-pool-1.4.jar:lib/commons-validator.jar:lib/cpool.jar:lib/cryptix-jce-provider.jar:lib/dom4j-1.6.1.jar:lib/ehcache-1.4.1-patched.jar:lib/fontbox-0.1.0.jar:lib/fop-0.92beta.jar:lib/freemarker-2.3.13.jar:lib/guessencoding-1.0.jar:lib/hibernate-3.2.6-patched.jar:lib/hrtlib.jar:lib/hsqldb.jar:lib/htmlparser-1.6.jar:lib/icu4j_3_6_1.jar:lib/jakarta-oro-2.0.8.jar:lib/jaxen-1.1-beta-8.jar:lib/jaxrpc.jar:lib/jbpm-identity-3.2.jar:lib/jbpm-jpdl-3.2.2.jar:lib/jcr-1.0.jar:lib/jgroups-2.6.2.jar:lib/jibx-bind.jar:lib/jibx-run.jar:lib/jid3lib-0.5.jar:lib/JMagick.jar:lib/joda-time-1.2.1.jar:lib/jooconverter-2.1.0.jar:lib/json.jar:lib/jstl-1.1.0.jar:lib/jta.jar:lib/jug-lgpl-2.0.0.jar:lib/jut.jar:lib/log4j-1.2.8.jar:lib/lucene-analyzers-2.1.0.jar:lib/lucene-core-2.1.0.jar:lib/lucene-snowball-2.1.0.jar:lib/mail.jar:lib/myfaces-api-1.1.5.jar:lib/myfaces-impl-1.1.5.jar:lib/naming-factory.jar:lib/naming-resources.jar:lib/odf_utils.jar:lib/odmg-3.0.jar:lib/openoffice-juh-2.0.3.jar:lib/openoffice-jurt-2.0.3.jar:lib/openoffice-ridl-2.0.3.jar:lib/openoffice-sandbox-2.0.3.jar:lib/openoffice-unoil-2.0.3.jar:lib/opensaml-1.0.1.jar:lib/pdfbox-0.7.3.jar:lib/poi-3.1.jar:lib/portlet-api-lib.jar:lib/quartz-1.6.0.jar:lib/resolver.jar:lib/rhino-js-1.6R7.jar:lib/saaj.jar:lib/saxpath.jar:lib/spring-2.0.8.jar:lib/springmodules-jbpm31.jar:lib/standard.jar:lib/tlc124.jar:lib/tm-extractors-1.0.jar:lib/tomcat-coyote.jar:lib/tomcat-util.jar:lib/truezip.jar:lib/truelicense-1_29.jar:lib/truexml-1_29-patched.jar:lib/wsdl4j-1.5.1.jar:lib/wss4j.jar:lib/xercesImpl-2.8.0.jar:lib/xml-apis.jar:lib/xmlgraphics-commons-1.0.jar:lib/xmlsec-1.4.0.jar:lib/xpp3-1.1.3_8.jar:lib/xstream-1.2.2.jar:../../../lib/mysql-connector-java-5.1.8-bin.jar:../../../common/endorsed/serializer.jar:../../../common/endorsed/xalan.jar:lib/axis-1.4.jar:../../../lib/servlet-api.jar:lib/ibatis-2.3.0.677.jar:../../share/WEB-INF/lib/alfresco-jlan-embed.jar:lib/alfresco-enterprise-repo.jar:lib/subetha-smtp.jar:lib/xmlrpc.jar:lib/jsr107cache-1.0.jar org.alfresco.tools.Export -user admin -pwd admin -store user://alfrescoUserStore -verbose users.acp




Note: On Linux, Alfresco 3.2r2 Community, run this from TOMCAT/webapps/alfresco/WEB-INF directory.




java -classpath classes/alfresco/module:../../../shared/classes:classes:lib/acegi-security-0.8.2_patched.jar:lib/activation.jar:lib/addressing-1.0.jar:lib/alfresco-core-3.2r2.jar:lib/alfresco-deployment-3.2r2.jar:lib/alfresco-linkvalidation.jar:lib/alfresco-mbeans-3.2r2.jar:lib/alfresco-remote-api-3.2r2.jar:lib/alfresco-repository-3.2r2.jar:lib/alfresco-web-client-3.2r2.jar:lib/ant.jar:lib/antlr-2.7.5H3.jar:lib/aopalliance.jar:lib/avalon-framework-4.2.0.jar:lib/bcel.jar:lib/bcprov-jdk15-137.jar:lib/bsf-2.4.0.jar:lib/bsh-1.3.0.jar:../../../lib/catalina.jar:lib/cglib-nodep-2.2_beta1.jar:lib/chiba-1.3.0-patched.jar:lib/commons-beanutils-1.7.0.jar:lib/commons-codec-1.3.jar:lib/commons-collections-3.1.jar:lib/commons-dbcp-1.2.2.jar:lib/commons-digester-1.6.jar:lib/commons-discovery-0.2.jar:lib/commons-el.jar:lib/commons-fileupload-1.1.1.jar:lib/commons-httpclient-3.1.jar:lib/commons-io-1.1.jar:lib/commons-jxpath-1.2.jar:lib/commons-lang-2.1.jar:lib/commons-logging-1.1.jar:lib/commons-modeler.jar:lib/commons-pool-1.4.jar:lib/commons-validator.jar:lib/cpool.jar:../../../lib/cryptix-jce-provider.jar:lib/dom4j-1.6.1.jar:lib/ehcache-1.4.1-patched.jar:lib/fontbox-0.8.0-incubating.jar:lib/fop-0.94.jar:lib/freemarker-2.3.13.jar:lib/guessencoding-1.0.jar:lib/hibernate-3.2.6-patched.jar:lib/hrtlib.jar:lib/hsqldb.jar:lib/htmlparser-1.6.jar:lib/icu4j_3_6_1.jar:lib/jakarta-oro-2.0.8.jar:lib/jaxen-1.1-beta-8.jar:lib/jaxrpc.jar:lib/jbpm-identity-3.3.1.jar:lib/jbpm-jpdl-3.3.1.jar:lib/jcr-1.0.jar:lib/jgroups-2.8.0-b2.jar:lib/jibx-bind.jar:lib/jibx-run.jar:lib/jid3lib-0.5.jar:lib/JMagick.jar:lib/joda-time-1.2.1.jar:lib/jooconverter-2.1.0.jar:lib/json.jar:lib/jstl-1.1.0.jar:lib/jta.jar:lib/jug-lgpl-2.0.0.jar:lib/jut.jar:lib/log4j-1.2.15.jar:lib/lucene-analyzers-2.4.1.jar:lib/lucene-core-2.4.1.jar:lib/lucene-snowball-2.4.1.jar:lib/mail.jar:lib/myfaces-api-1.1.5.jar:lib/myfaces-impl-1.1.5.jar:lib/naming-factory.jar:lib/naming-resources.jar:lib/odf_utils.jar:lib/odmg-3.0.jar:lib/openoffice-juh-2.0.3.jar:lib/openoffice-jurt-2.0.3.jar:lib/openoffice-ridl-2.0.3.jar:lib/openoffice-sandbox-2.0.3.jar:lib/openoffice-unoil-2.0.3.jar:lib/opensaml-1.0.1.jar:lib/pdfbox-0.8.0-incubating.jar:lib/poi-3.5-FINAL-20090928.jar:lib/portlet-api-lib.jar:lib/quartz-1.6.0.jar:lib/resolver.jar:lib/rhino-js-1.6R7.jar:lib/saaj.jar:lib/saxpath.jar:lib/spring-2.0.8.jar:lib/springmodules-jbpm31.jar:lib/standard.jar:../../../lib/tlc124.jar:lib/tm-extractors-1.0-patched.jar:../../../lib/tomcat-coyote.jar:../../../lib/tomcat-util.jar:lib/truezip.jar:../../../lib/truelicense-1_29.jar:../../../lib/truexml-1_29-patched.jar:lib/wsdl4j-1.6.2.jar:lib/wss4j.jar:lib/xercesImpl-2.8.0.jar:lib/xml-apis.jar:lib/xmlgraphics-commons-1.2.jar:lib/xmlsec-1.4.1.jar:lib/xpp3-1.1.3_8.jar:lib/xstream-1.2.2.jar:../../../lib/mysql-connector-java-5.1.7-bin.jar:../../../endorsed/serializer.jar:../../../endorsed/xalan.jar:lib/axis-1.4.jar:../../../lib/servlet-api.jar:lib/ibatis-2.3.4.726-patched.jar:../../share/WEB-INF/lib/alfresco-jlan-embed-3.2r2.jar:lib/subetha-smtp.jar:lib/xmlrpc.jar:lib/jsr107cache-1.0.jar:lib/alfresco-webscript-framework-3.2r2.jar:lib/abdera-client-0.4.0-incubating.jar:lib/abdera-core-0.4.0-incubating.jar:lib/abdera-extensions-json-0.4.0-incubating.jar:lib/abdera-i18n-0.4.0-incubating.jar:lib/abdera-parser-0.4.0-incubating.jar:lib/axiom-api-1.2.5.jar:lib/axiom-impl-1.2.5.jar:lib/greenmail-1.3-patched.jar org.alfresco.tools.Import -user admin -pwd admin -store user://alfrescoUserStore -verbose -uuidBinding UPDATE_EXISTING backup_users.acp




Note: Ubuntu/Debian with Alfresco 4.0 Community. Run this from <TOMCAT>/webapps/alfresco/WEB-INF directory.




java -XX:MaxPermSize=512m -classpath `locate servlet-api.jar`:classes/alfresco/module:classes:lib/* org.alfresco.tools.Export -user <MyUser> -pwd <MyPassword> -s workspace://SpacesStore -verbose -p /sys:system/sys:authorities  -d /tmp authorities.xml



Note: The classpath in the above example is out of date- it might need updating with new jar versions for your installation.

Note: Future versions of the tools will allow direct Export and Import against a remote Repository.

Note: This tool has name collision with unix/linux bash built-in command 'export' . Use proper name for it, like import.sh or other.

Note: You cannot import this ACP to another alfresco then the one you have exported from. For this you need to do a full repository export. 

Note: When exporting users you might get what seems to be a corrupt ACP. You can fix this by renaming the acp , 'XML' and putting it in a zip with the same name with the extension ACP. 

 export_users.acp --> export_users.xml   
Create a new zip called 'export_users.zip' and put the xml inside  
Rename export_users.zip to export_users.acp  

You can now restore your file.


Export Tool


org.alfresco.tools.Export



Usage: export -user username -s[tore] store [options] packagename

username: username for login
store: the store to extract from in the form of scheme://store_name
packagename: the filename to export to (with or without extension)

Options:
-h[elp] display this help
-p[ath] the path within the store to extract from (default: /)
-d[ir] the destination directory to export to (default: current directory)
-pwd password for login
-packagedir the directory to place extracted content (default: dir/<packagename>)
-root extract the item located at export path
-nochildren do not extract children
-overwrite force overwrite of existing export package if it already exists
-quiet do not display any messages during export
-verbose report export progress
-zip export in zip format

For example:

export -user admin -pwd admin -s workspace://SpacesStore -verbose SpacesStore.acp

Note: This tool is not included in Alfresco Labs 3b


Default Stores


The following are default Alfresco repository stores to be used as parameters:


  • archive://SpacesStore - archival workspace
  • system://system 
  • user://alfrescoUserStore - user information
  • workspace://lightWeightVersionStore 
  • workspace://SpacesStore - most of the information in the repository

Import Tool


org.alfresco.tools.Import



Usage: import -user username -s[tore] store [options] packagename

username: username for login
store: the store to import into the form of scheme://store_name
packagename: the filename to import from (with or without extension)

Options:
-h[elp] display this help
-p[ath] the path within the store to import into (default: /)
-d[ir] the source directory to import from (default: current directory)
-pwd password for login
-encoding package file encoding (default: windows-1252)
-quiet do not display any messages during import
-verbose report import progress
-uuidBinding CREATE_NEW, REMOVE_EXISTING, REPLACE_EXISTING, UPDATE_EXISTING, THROW_ON_COLLISION (default: CREATE_NEW)

For example:

import -user admin -pwd admin -s workspace://SpacesStore -verbose SpacesStore.acp

import -user admin -pwd admin -s workspace://SpacesStore -verbose SpacesStore.xml

As you'll see from the examples, it is possible to import from an ACP file or just an XML file. Importing just XML is useful if you want to import Nodes without associated binary content e.g. People.


Export & Import Foundation APIs


The Alfresco Foundation Services API provides export and import capabilities.


Export Foundation API Example


The Alfresco Java service API provides an Exporter service.  This service provides various ways of exporting data out of the Repository, although the most commonly used method is:

public void exportView(ExportPackageHandler exportHandler, ExporterCrawlerParameters parameters, Exporter progress)
   throws ExporterException;

where:


  • exportHandler is responsible for how the exported data is rendered
  • parameters defines the set of nodes to export
  • progress is a call-back for tracking what is being exported during export

For example, to export the complete Workspace used by Alfresco's Web Client to an ACP file the following code snippet can be used:

// define which part of the Repository to export
Location location = new Location(new StoreRef('workspace', 'SpacesStore'));
location.setPath('/');
ExporterCrawlerParameters parameters = new ExporterCrawlerParameters();
parameters.setExportFrom(location);


// setup an ACP Package Handler to export to an ACP file format
ExportPackageHandler handler = new ACPExportPackageHandler(...);


// now export (note: we're not interested in progress in the example)
exporter.exportView(handler, parameters, null);

Upon completion of exportView, the ACP file will exist at the location defined by the handler.


Import Foundation API Example


The Alfresco Java service API provides an Importer service.  This service provides various ways of importing data into the Repository, although the most commonly used method is:

public void importView(ImportPackageHandler importHandler, Location location, ImporterBinding binding, ImporterProgress progress)
   throws ImporterException;

where:


  • importHandler is responsible for extracting repository nodes from the provided import file (e.g. ACP file)
  • location defines where to import into the repository
  • binding provides the ability to substitute variables within the import file and specifiy the import binding
  • progress is a call-back for tracking what is being imported during export

For example, to import the complete Workspace as exported above into a fresh repository, the following code snippet can be used:

// specify the location within the Repository to import into
Location location = new Location(new StoreRef('workspace', 'SpacesStore') );


// setup an ACP Package Handler to import from an ACP file
ImportPackageHandler handler = new ACPImportPackageHandler(...);


// import (note: in this example we're not interested in progress)
importer.importView(handler, location, null, null);

Upon completion of importView, the information held within the ACP file will now reside within the Repository.  As with all service API calls, the import takes place within the context of a transaction and so now the imported data can be committed or rolled-back.


JSR-170 Export & Import Support


The Alfresco Repository supports JSR-170 Level 1 and Level 2 which includes export and import of:


  • JSR-170 System View XML
  • JSR-170 Document View XML

Refer to the JSR-170 specification for details of these
file formats and the APIs used for exporting and importing.


Export & Import of the AVM (Web Projects)


{{AVMWarning}}
The export / import functionality described here currently does not include support for AVM stores (which form the basis of the Alfresco WCM functionality).  Alfresco WCM has its own deployment facilities.




Back to Server Administration Guide

Attachments

Outcomes