Previous Next JavaScript must be enabled to correctly display this content

## 3.11.11.1.6 Exporting One or More Applications

Use SQLcl to export a single APEX application or all applications in a workspace.

- Exporting an Application to a Single File
  Export an APEX application to a single file.
- Exporting All Applications from a Workspace
  Export all APEX applications in a workspace.
- Exporting an Application Split into Multiple Files
  Export an APEX APEX application as a directory which contains all the application components as separate files.
- Why the Split Option is Preferable for Source Control
  Learn about the advantages of using `apex export` with the `-split` option with source control.
- Exporting Only Selected Application Components
  Export some application components by specifically listing the components by type and ID.
- Additional Options for Controlling APEX Application Export
  Learn about additional `apex export` command options.

Parent topic: Exporting and Importing Using SQLcl

### 3.11.11.1.6.1 Exporting an Application to a Single File

Export an APEX application to a single file.

To export an APEX application to a single file, use the `apex export` command and provide the application ID.

In this example, the application ID is `113`.

    SQL> apex export -applicationid 113

Parent topic: Exporting One or More Applications

### 3.11.11.1.6.2 Exporting All Applications from a Workspace

Export all APEX applications in a workspace.

To export all applications in a workspace, use the `apex export` command and provide the workspace ID.

In this example, the workspace ID is `1908816359534887`.

    SQL> apex export -workspaceid 1908816359534887

    Exporting Application 106:'Sample Interactive Grids'
    Exporting Application 110:'Books with Tags'
    Exporting Application 113:'List Examples'
    Exporting Application 117:'HR App'

Parent topic: Exporting One or More Applications

### 3.11.11.1.6.3 Exporting an Application Split into Multiple Files

Export an APEX APEX application as a directory which contains all the application components as separate files.

To export an application as a directory with each application component split into a separate file, use the `apex export` command and include the application ID and the `-split` option.

In this example, the application ID is `113`.

    SQL> apex export -applicationid 113 -split

The previous example would create the `f113` directory (in the current directory) containing the `install.sql` script and an application directory. This applcation directory contains all the application components organized into logical subdirectories. Each distinct component is exported to a separate file.

Parent topic: Exporting One or More Applications

### 3.11.11.1.6.4 Why the Split Option is Preferable for Source Control

Learn about the advantages of using `apex export` with the `-split` option with source control.

Using `apex export` with `-split` option offers a more granular approach for exporting an application. This approach also makes source control change tracking tools more useful by enabling developers to see and review changes made to their application at the component level.

For example, suppose you add a new application feature on a new page (for example, page 11), modify the existing page 3, and modify an existing shared LOV named `tags_lov`. Exporting the application using the `-split` option enables your source control system to list the specific pages and LOV separately in its "what's changed?" report.

Then, suppose you are using the popular source control system Git. You could see what changes are pending using the `git status` command as shown in the the following example:

    [./f113]$ git status
    On branch main
    Changes to be committed:
            new file:   application/pages/page_00011.sql
            modified:   application/pages/page_00003.sql
            modified:   application/shared_components/user_interface/lovs/tags_lov.sql
            modified:   application/create_application.sql
            modified:   install.sql

Notice that the list of changed files indicates that page 11 was added, page 3 was modified, and the existing shared components LOV named `tags_lov` was also modified. Also notice that the `install.sql` file and `create_application.sql` file also were modified to reflect the addition of a new page to the application.

In contrast, if you export the application as a single file, the source control system can only list that one file as being modified, making it less clear what aspects of the application have changed. Similarly, reviewing changes made by colleagues becomes easier when you consider the changes in the context of a smaller amount of surrounding text and a meaningfully named subdirectory that explains the purpose of the file being reviewed.

Parent topic: Exporting One or More Applications

### 3.11.11.1.6.5 Exporting Only Selected Application Components

Export some application components by specifically listing the components by type and ID.

You can perform a partial export of application components by specifically listing the component by type and ID.

The following example demonstrates how to list the components changed in application 113 made on or after January 22, 2022 and then export only those components split into separate files using the `-expComponents` option.

    SQL> apex list -applicationid 113 -changesSince 2022-01-22
    LAST_UPDATED_ON  ID                                      NAME
    2022-01-22 14:59 LOV:23618973754424510000                TAGS_LOV
    2022-01-22 14:59 PAGE:3                                  3. Book
    2022-01-22 15:00 PAGE:11                                 11. Library Search

    SQL> apex export -applicationid 113 -expComponents "LOV:23618973754424510000 PAGE:3 PAGE:11"
    Exporting Application 113

The previous example produces a single `f113.sql` file containing only the necessary contents to install the three indicated components.

You can also use the `-split` option as shown in the following example:

    SQL> apex export -applicationid 113 -split -expComponents "LOV:23618973754424510000 PAGE:3 PAGE:11"
    Exporting Application 113

This produces the `f113` directory and just the necessary files to install these three components. Notice that in this example the main SQL script is named `install_component.sql` instead of `install.sql`.

    [./f113]$ find . | grep \.sql
    ./application/pages/page_00003.sql
    ./application/pages/page_00011.sql
    ./application/shared_components/user_interface/lovs/tags_lov.sql
    ./application/pages/delete_00003.sql
    ./application/pages/delete_00011.sql
    ./application/set_environment.sql
    ./application/end_environment.sql
    ./install_component.sql

Parent topic: Exporting One or More Applications

### 3.11.11.1.6.6 Additional Options for Controlling APEX Application Export

Learn about additional `apex export` command options.

Use the following `apex export` command options to adjust what gets exported along with your application.

Option | Description
--- | ---
`-expFiles` | Export all workspace files identified by `-workspaceid`
`-expType` | Comma delimited list of export types:`APPLICATION_SOURCE (default), READABLE_YAML, EMBEDDED_CODE, CHECKSUM-SH1 or CHECKSUM-SH256`
`-skipExportDate` | Exclude export date from application export files
`-expPubReports` | Export all user saved public interactive reports
`-expSavedReports` | Export all user saved interactive reports
`-expIRNotif` | Export all interactive report notifications
`-expTranslations` | Export the translation mappings and all text from the translation repository
`-expOriginalIds` | Export will emit IDs as they were when the application was imported
`-expNoSubscriptions` | Do not export references to subscribed components
`-expComments` | Export developer comments
`-expSupportingObjects` | Pass `Y` for yes, `N` for no, or the letter `I` to export and automatically install supporting objects on import
`-dir` | Save all files in the given directory, e.g. -dir some/sub/directory
`-expComponents` | Export application components. All remaining parameters must be of form `TYPE:ID`
`-debug` | Print debug output
`-nochecksum` | Overwrite existing files even if the contents have not changed
`-split` | Split applications into multiple files

Parent topic: Exporting One or More Applications