Issue
- "The LAR file could not be imported because it requires page templates or site templates" error message apprears when the user is importing pages from different Liferay systems.
Environment
DXP 7.0 or higher
Resolution
When importing pages, in some cases we could obtain this error message. "The LAR file could not be imported because it requires page templates or site templates"
This is produced because this page importation requires the page or the site templates used in the origin system to be imported in the destiny system.
It also applies to the DEFAULT TEMPLATES because this templates could be changed, so the origin system status of this default template could be different to the destiny system current status. Even if they are DEFAULT TEMPLATES, ONCE THEY ARE CREATED IN DIFFERENT SYSTEMS, THEY ARE CONSIDERED DIFFERENT TEMPLATES.
The required templates appear in the message. Let's see an example (in spanish):
El archivo Páginas_privadas-20210524072117010.lar no puede importarse.
No pudo importarse el archivo LAR porque requiere plantillas de página o de sitio que no se han encontrado. Por favor, importe las siguientes plantillas de forma manual:
Plantilla del sitio web: Sitio de intranet(143ab40c-61a8-8791-5111-e3d516da3e3a)
The last paragraph specifies the required template showing the title and it's uuid: Sitio de intranet(143ab40c-61a8-8791-5111-e3d516da3e3a)
To solve the issue you only have to export and import this template. (see https://help.liferay.com/hc/es/articles/360029132551-Importing-Exporting-Sites-and-Content#export-templates for more details)