cancel
Showing results for 
Search instead for 
Did you mean: 

Best Way to Uninstall a AMP Module

cgonzalez
Champ on-the-rise
Champ on-the-rise
Hi,

I have developed a amp module than extends Alfresco, it works fine,but now i want to uninstall it. How can i do that?

If have readed that there's no good way to do that.

Any tip?
1 ACCEPTED ANSWER

jpotts
World-Class Innovator
World-Class Innovator

Old thread, but in case it is helpful, in 5.x you can also use the Node Browser at /alfresco to browse the same path and delete exactly the module you need to.

View answer in original post

19 REPLIES 19

In Alfresco 5.x the version is stored as a serialized object - so no fun in the database. Instead you could just remove all module registrations using java script and restart. If you can't even start you need to restore the original war first:

var searchString = "/sys:system-registry/module:modules/*"; // XPath search string
var store = "system://system";
var nodes = search.selectNodes(store, searchString);

for each (var node in nodes) {
logger.log("removing entry for module: " + node.name);
   node.addAspect("sys:temporary");
    node.remove();
}

jpotts
World-Class Innovator
World-Class Innovator

Old thread, but in case it is helpful, in 5.x you can also use the Node Browser at /alfresco to browse the same path and delete exactly the module you need to.

4535992
Star Collaborator
Star Collaborator

HI can you be more specific on how do that on the path /alfresco ?

Hi Marco Tenti‌,

You can access to Node Browser named by Jeff Potts‌ in the following URL http://{alfrescoIP}:{alfrescoPort}/alfresco/s/admin/admin-communitysummary. In this page, you can select Node Browser tool and search "/sys:system-registry/module:modules/*" with option "selectnodes". After that, you can view all modules installed in your system and the modules which have been installed and removed from your Alfresco.

Regards,

Sergio.

4535992
Star Collaborator
Star Collaborator

Ty very much, save me a lot of time.

Please make sure your removed amp did not provide a document model which is referenced by existing nodes (by document type and/or aspects). Alfresco will not complain until you open or modify an affected node or version and errors occur months or years later when you don't expect them.

It’s a very important note!!!

heiko_robert
Star Collaborator
Star Collaborator
There was an ongoing discussion in JIRA about the module registry cleanup: "uninstalling an AMP should remove the module nodes in the repository"
unfortunately the issue "RA-44" has been removed from public access …
Any comments on that from Alfresco side?

Anyway - we have a solution with the java script for the hard coded removal but would expect a more consistent way which also includes an API for model migration.

I created a new issue in JIRA as a requirement for module management:
ALF-21399 support for document model migration and downgrade https://issues.alfresco.com/jira/browse/ALF-21399

Please vote this issue if you think this is relevant for you also!

Thanks

Since the issue ALF-21399 has been closed as "not a bug" I'd like to share that we worked around this long story by implementing a hardcore Alfresco extension which is able to migrate, up- and downgrade Alfresco Types. The implementation has a javascript binding to call a migration batch job for specific types and expects a function (getting the old property array as argument) which takes care how to save the old values in other properties, jdbc datasources ...

If anybody is interested, please send me a pm. We decided not to publish this extension (yet) since it will be very easy to loose data if you have bugs in the custom function. But as always: With great power comes great responsibility!

Hi Heiko i'm interested to try out the extension you talk it about, i can't send you a pm because i'm must be friend or follow by you for send the message.

Ty.

Greeting.