Liferay Support does not recommend or endorse specific third-party products over others. Liferay is not responsible for any instructions herein or referenced regarding these products. Any implementation of these principles is the responsibility of the subscriber.
This article outlines a number of suggested practices for using Liferay Portal's staging feature. Following these principles will help prevent future issues and ensure that your staging environment operates as smoothly as possible.
The following practices should be followed to ensure the best experience while staging in Liferay Portal. The steps fall into five categories:
- When reordering pages within a staged site, note that for the changes to be effected into the live site, a "publish all" must occur. Note that in many enterprise environments, the "publish all" feature may take a long amount of time to complete due to the amount of data in the WCM and Document Library portlets.
- Because of this, a feasible workaround for many subscribers is simply to publish “All Pages” without publishing any data. That is, publish all pages, while making sure to deselect any portet data or content. This will allow for a quick “Publish All” that reorders the pages in question.
- Other ways to avoid the potential slowdown of reordering pages could include breaking large sites into smaller sites or simply changing the page order as little as possible. However, the above method will work in cases where these two options are not feasible.
Pages - Linking to Unpublished Pages
- When creating content that references a newly created page, make sure to publish that page before linking to it in the content you are creating.
- In remote staging, a new, unpublished page is given a “pseudo-link” which operates as a placeholder until after that page is published
- When publishing pages that have custom themes, it is important that the Theme Settings checkbox is checked or the Live page will have the default Liferay theme.
- This is because: When selected on export, the theme and color scheme chosen for the site are included in the resulting LAR files. When selected on import, the theme and color scheme settings are imported and all the pages are configured to use them.
- There is a known issue where the
COLORSCHEMEIDare deleted on subsequent publications. See LPS-92943 for more information.
Changing Web Content Permissions in Remote Live
- When changing permissions for a web content in local live staging, make sure to “touch” the piece of content to flag it as “modified”. This will ensure that the content (and its permissions) are updated when a publish occurs. Note that this only applies to remote live staging as local live staging does not require the republishing of content to enact permissions change.
Communicate Standard for Using “Live-editable” Portlets
- Note that some of the portlets in Liferay allow users to make changes to the live version of the staged portlet.
- In order to avoid publication errors, list all of the assets that can be modified in the live site and then clearly communicate to users of the portal where changes should be made (whether in staging or directly in live.
- For example, in the calendar portlet, events can be created directly in the live site. Administrators should communicate to all potential event creators where to create their live events (whether in staging or directly in live). If events are created in both the staging site and the live site, future publications will likely fail.
- When utilizing multiple languages within a site, make sure to:
Only use languages that have been defined within the site
Difficulties arise when the portal encounters content in a locale that is not defined on the site.
e.g. If English and Spanish are the defined languages, and you’d like to remove English, make sure to remove all content in English.
Even “small changes” Iike from en_US to en_GB) will cause this issue so be careful with the web content that you use on the portal.
Use the same languages across the portal, sites, and content
e.g. There should not be a site that utilizes Chinese when the only languages defined for the portal are English and Spanish.
- Only use languages that have been defined within the site
- Every language element needs to be exactly the same between the live and staged site. If there are discrepancies between the languages on the two sites, the publish will likely fail.
Use Original Names for Documents
- When renaming an entity, make sure to give that entity a name that has not been used in the past to name that same document.
- Also, be very careful when renaming a file in the document library as problems may arise from using the name of another file in the document library.
Use the Global Scope When Linking Assets from Multiple Sites
- For entities that will be used in multiple sites, make sure to place them in the global scope. Entities like web content, structures, templates, documents, vocabularies and categories, application display templates, and DDLs are not intended to be shared across sites unless those entities belong to the global scope.
- As such, publishing to live may not work if there are references to entities that do not belong to that site or the global site.
- For more information, please see the corresponding knowledge base article.
- Note that the functionality for this may change in Liferay 7.0.
Create a Plan for Maintaining Database-File System Consistency
- In the case of a staging failure, a transactional database will be able to revert back to its original state. However, the file system (if it is not “database-stored” like DBStore) is not transactional and therefore will need be rolled back. This could potentially cause a discrepancy between a file and where it is being referenced from.
- Because of this, administrators should take great care if they decide to stage the document library, making sure that regular backups of both their database and their file system are being maintained. Administrators should also ensure that it is clear which file system backups will correspond with particular database backups.
- Make sure that the same patches are applied to all servers being used in order to avoid possible staging issues. For more information on that please check this Knowledge Base Article.
Changing Settings in Live, Embedded Portlets
- Changing preferences in embedded portlets is less straightforward than changing settings for out-of-the-box portlets. The easiest way to avoid issues is simply to push the embedded portlet to live with the understanding that the settings will be static. However, if settings must be altered they may be changed with a script which allows the deleting or changing of the settings directly in the database. This operation will be at the discretion of the administrator.
- For environments that utilize both global and local vocabularies, note that global vocabularies must be published to the live site through global site staging. One way to avoid confusion with vocabularies is to simply keep all vocabularies local or global. If both must be utilized, administrators should ensure that publishing changes to the global site is part of the content-editing process.