cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot import workspace://spacesStore repository with ACP

jevon
Champ in-the-making
Champ in-the-making
Hi all,

I'm having difficulties using the ACP export/import feature of Alfresco as a way to backup and restore an Alfresco repository. This is a fairly empty repository on a local dev machine - the entire repository is only about 40MB.

I've exported the workspace://SpacesStore repository using the following command, as described at http://wiki.alfresco.com/wiki/Export_and_Import:

java -Xms128m -Xmx768m -XX:MaxPermSize=256m -classpath ../../lib/*;../../lib/ext/*;../../shared/classes;WEB-INF/classes/;../../shared/lib/*;WEB-INF/lib/* org.alfresco.tools.Export -user admin -pwd admin -store workspace://SpacesStore -verbose c:/hubnet/temp/workspace-spacesStore.xml

This creates workspace-spacesStore.xml and a folder workspace-spacesStore which contains all of the raw files.

To import the workspace, I've deleted the existing Alfresco database and the old Alfresco data. I then try to import the same workspace using the command:

java -Xms128m -Xmx768m -XX:MaxPermSize=256m -classpath ../../lib/*;../../lib/ext/*;../../shared/classes;WEB-INF/classes/;../../shared/lib/*;WEB-INF/lib/* org.alfresco.tools.Import -user admin -pwd admin -store workspace://SpacesStore -verbose c:/hubnet/temp/workspace-spacesStore.xml

Since the database and alf_data folders do not exist, they are created and initialised (I think). The import is subsequently not successful, and the following exception occurs:

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '6-wf-email-html-ftl' for key 'store_id'
; SQL []; Duplicate entry '6-wf-email-html-ftl' for key 'store_id'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExcepti
on: Duplicate entry '6-wf-email-html-ftl' for key 'store_id'

If I use the argument -uuidBinding REPLACE_EXISTING, the same exception occurs.

If I use the argument -uuidBinding REMOVE_EXISTING, I get the following exception instead:

org.alfresco.error.AlfrescoRuntimeException: 02070017 site deletion is not allowed. Attempted to delete workspace://SpacesStore/b4cff62a-664d-4d45-9302-98723eac1319

If I use the argument -uuidBinding UPDATE_EXISTING, I get the following exception instead:

org.alfresco.service.cmr.rendition.RenditionServiceException: 02080017 Multiple rendition definitions with the name: {http://www.alfresco.org/model/content/1.0}doclib exist!

Therefore I've run out of options. How are you supposed to import an ACP file into a new repository? I haven't had any success at all.

I've also not been able to import the user://alfrescoUserStore, system://system or workspace://lightWeightVersionStore repositories. The only repository I've had success in importing is the archive://SpacesStore repository, but since none of my workspace changes affect this repository, it's effectively useless. This is Alfresco Community 4.0.c.

Any ideas or feedback would be most welcome. Right now my backup/restore approach is through dumping the database through mysqldump, and copying the data itself using rsync. At least with mysqldump & rsync you can backup a running Alfresco instance.
7 REPLIES 7

jpotts
World-Class Innovator
World-Class Innovator
Dumping the database and copying the content store is the preferred method of a backup and restore. Especially because you are trying to restore into a new repository. I'd use that approach rather than ACP.

Jeff

jevon
Champ in-the-making
Champ in-the-making
Hi Jeff,

Thanks for your answer. We were looking at ACPs because we asked about the scenario of moving content between repositories, e.g. development to production environment, and you recommended ACPs at https://forums.alfresco.com/en/viewtopic.php?f=10&t=42847 .

I understand that ACPs are better for moving/copying/restoring parts of the repository, but does this mean ACPs can't be used to copy/restore an entire repository? Does ACP export/import support browsing through the repository, e.g. workspace://spacesStore/user_sites/myusername or whatever?

If ACPs are intended to backup/restore entire repositories (as implied at the wiki link), are the problems listed above expected?

Or, are ACPs only intended to copy repositories within a single Alfresco instance, e.g. workspace://spacesStore to workspace://spacesStoreBackup?

Cheers

mrogers
Star Contributor
Star Contributor
ACPs are only partial dumps that's why the "full repository export" option is not allowed.   It is "good enough" for trees of documents etc, but ultimately is on the backlog to be replaced.

jpotts
World-Class Innovator
World-Class Innovator
jevon,

In my forum post you cited is an important disclaimer: "…depending on how much content you are moving between environments…"

I would definitely not use ACP for a full repo migration.

Jeff

jevon
Champ in-the-making
Champ in-the-making
Thanks for the replies, I thought that might be the case.

In that case, how can one tell when it would be appropriate to use ACP, and when it would be appropriate to use a full database dump? What directory trees can and cannot be exported/imported using ACP? How does the ACP export/import command line tool support sub-trees, I guess with the -path argument?

jpotts
World-Class Innovator
World-Class Innovator
I think a good rule of thumb would be to say that if you are exporting and importing instances of cm:content (or a child type) you are fine with ACP's up to a certain volume. What that volume is (in terms of both number and size) depends entirely on your configuration (hardware and software), but I don't think I'd use ACP for more than a few thousand nodes of "reasonable" size. Sub-directories are fine.

Wish I could give you a more specific answer,

Jeff

mittromney
Champ in-the-making
Champ in-the-making
Wow neat! This is a really, great site! I am wondering, if anyone else has come across, something, similar in the past? Keep up, the great work! Smiley Happy