Sites

Exporting/Importing Data with LAR Files

You can use Liferay Archive (LAR) files to transfer data between Liferay environments, including pages, widgets, or instance-wide data (such as roles).

The export and import tools are available on the site or instance level. Site or instance scoped data must be imported using the same scope in the target environment.

Note

Exporting and importing instance-level LAR files requires Liferay DXP 2025.Q4+, and enabling a developer feature flag. Set feature.flag.LPD-35914=true to enable the Export and Import options in the Applications menu.

Tip

You can also use Site Initializers to create sites pre-populated with pages and content. Site Initializers are client extensions, and developers creating client extensions must understand Liferay’s database and systems to implement them.

LAR File Usage

LAR files are version-dependent, but you can export and import them into any Liferay instance of the same version.

You can use site-scoped LARs to restore a site, but you must delete the site entirely and then create a new site with the same name to import the LAR. This avoids potential data conflicts between content that exists both in the LAR and in the site.

LAR files are not stored permanently in the system. After an export or import process completes, Liferay deletes the entry on the Export or Import screen after 30 days, regardless of the outcome (successful, canceled, or failed). After an export process, the LAR file is downloadable (temporarily stored in the Documents and Media Library) for 30 days.

Important

Exporting LARs is not a backup solution; it’s intended for migrating data between environments. See Backing up a Liferay Portal Installation to learn about backing up your Liferay installation.

Exporting Data

You can export data at two scopes: instance and site.

If your site content references instance-level data (e.g., global categories or page templates), you must import that data in a separate, instance-level LAR file before importing the site data. Data exported in an instance LAR can only be imported at the instance level to another Liferay instance with the same version.

If you plan to export site-level data, begin by identifying any instance-level dependencies. If your site is based on a site template or the content references any instance-level data (e.g., global categories), you must export these at the instance level.

Export instance-scoped LAR files via the Applications menu (Applications), under Export.

Access the Export menu for instance-level data in the Applications menu.

Data exported in a site LAR can only be imported to another site on the same version of Liferay that already has any instance-level dependencies.

Export site-scoped LAR files via the site menu, under PublishingExport.

Access the Export menu for site data in the site menu.

Configuring the Export

  1. On the Export page (site-level or instance-level), click New to create a new export process.

    This opens an export template.

  2. Configure the export process by selecting what you want to export under Pages and Content.

    The type of export determines what kinds of data can be selected.

    Site-level and instance-level exports allow for exporting different types of data.

    Warning

    Exporting page templates can increase export durations by including pages that use them. To improve export durations, uncheck Page Templates under Content → Pages.

  3. Under Content, configure whether to export all data for the selected applications or to filter included application data by date or time.

  4. Under Permissions, determine whether to include permissions for all of the applicable applications in the export.

  5. Click Export to begin the export process.

  6. Once finished, click Download (Download) on the list of export processes to download the generated LAR file.

Download the generated LAR file from the list of export processes.

You can now import the LAR to another site or instance (depending on the export’s scope).

Important

The generated LAR includes all data selected during export configuration. If this includes private or sensitive information, ensure the LAR file is stored in a secure location.

Creating Export Templates

If you frequently export data, consider making an export template to store and reuse your export settings.

  1. Navigate to the Export page for the desired scope (site-level or instance-level).

  2. Click Options (Options) at the top of the page, and click Export Templates.

    Click the Actions button in the Application Bar and select Export Templates.

  3. Click New.

  4. Name and configure the export template.

  5. Click Save.

You can now select your template when creating a new export process. The template is only usable when starting an export with the same scope.

Importing Data with a LAR File

When you import a LAR file, some naming conflicts are handled automatically. For example, if you import a site-scoped LAR including a page with the same friendly URL as your target site, the imported page appends a number to the friendly URL (counting up until the conflict is resolved). This same strategy applies to category names.

Other kinds of errors that can’t be resolved automatically may not prevent the import from completing, depending on the application. If an import that included errors completes, click View Details on the import process to see the details for each error.

Similarly, if the LAR file contains object data, the target Liferay instance must have the corresponding object definitions already. Import them separately before you import the LAR.

Importing Instance Data

Import an instance-level LAR file containing any dependencies before importing site LAR files that reference them.

Import instance-scoped LAR files via the Applications menu (Applications), under Import.

Access the Import menu for instance-level data in the Applications menu.

Importing Site Data

Once you’ve finished importing any referenced instance-level data, import your site-scoped LAR file via the site menu, under PublishingImport.

Access the Import menu for site data in the site menu.

Configuring the LAR Import

  1. On the Import page (site-level or instance-level), click New to create a new import process.

  2. Select the desired LAR file and click Continue.

  3. Deselect any applications with data you don’t want imported.

  4. Under Deletions, configure whether to replicate or ignore individual deletions for the applications included in the import.

  5. Under Permissions, configure whether to assign the same permissions to the included entities in the target site or instance.

  6. (Site-level only) Under Update Data, choose the Mirror or Mirror with overwriting import strategy.

  7. Under Authorship of the Content, choose whether to keep the original authorship of imported content or to import content with your user treated as the author.

    Configure the import before you begin a new import process.

  8. Click Import to begin the import process.

Once finished, the applications you selected are imported into the target site or instance.

Configuring Export/Import Processes

Liferay provides settings for configuring export/import processes as well as staging-specific features. These settings affect staging and site template propagation.

SettingDescription
Include All Asset LinksIf checked, all asset links are included from the site within the given date range. If unchecked, only asset links connected to the content are included.
Replicate Individual Deletions by DefaultIf checked, delete operations performed for content types are always replicated in the target site by default.
Publish Permissions by DefaultIf checked, permissions assigned for exported pages and individual portlet windows are always included by default.
Validate File EntriesIf checked, publishing or importing content types with text causes Liferay to check the content for links to documents and ensure they point to valid documents.
Validate Journal Feed ReferencesIf checked, publishing or importing content types with text causes Liferay to check the content for references to web content feeds and ensure they point to valid feeds.
Validate Layout ReferencesIf checked, publishing or importing content types with text causes Liferay to check the content for links to one of the portal’s virtual hosts and ensure they point to a valid Liferay page. Uncheck this if your virtual host has pages outside Liferay.
Validate Missing ReferencesIf checked, publishing and import processes cause Liferay to check for missing references. If unchecked, missing reference validation is skipped. As a result, references without existing targets can be published or imported to the target site.