Migrating old extension environments
Ext plugins have been created as an evolution of the extension environment provided in Liferay 5.2 and previous versions of Liferay. Because of this a common need for projects upgrading from previous versions might be to migrate Extension environments into Ext plugins. The good news is that this task is automated and thus relatively easy.
Tip: When migrating an extension environment, it's worth considering if all or at least some of its features can be moved into other types of plugins such as portlets and hooks. The benefit of using portlets and hooks is that since they are focused on specific goals they are easier to learn. Additionally they are cheaper to maintain since they often require fewer changes when upgrading to a new version of Liferay.
The process of migrating consists of executing a target within the ext directory from Plugins SDK, pointing to the old extension environment and naming the new plugin:
ant upgrade-ext -Dext.dir=/projects/liferay/ext -Dext.name=my-ext -Dext.display.name="My Ext"
Here is a description of the three parameters used:
ext.dir is a command line argument to the location of the old Extension Environment.
ext.name is the name of the Ext plugin that you want to create
ext.display.name is the display name
After executing the target you should see the logs of several copy operations that will take files from the extension environment and copy them into the equivalent directory within the Ext plugin (read the section "Creating an Ext plugin" for an explanation of the main directories within the plugin).
When the migration process is complete, some additional tasks will be needed to upgrade the code to the new version of Liferay. Some of the most typical tasks are:
Review the uses of Liferay's APIs and adapt them accordingly.
Review the changes to the JSPs and merge your changes into the JSPs of the new Liferay version.
When using Service Builder you will need to run ant build-service again. It's also recommended to consider moving this code to a portlet plugin, because it is now as powerful and allows for greater modularity and maintainability.
If you've implemented portlets in Ext, migrate them to portlet plugins, as this capability is deprecated and is not guaranteed to be available in future releases.