Skip to Main Content

Info

You can use the APEXExport and APEXExportSplitter utilities to create Apex exports from the command line.
More info can be found in the API Reference.
Some info on how to set up APEXExport: https://apexplained.wordpress.com/2013/11/25/apexexport-a-walkthrough.

Note: Not everything is exported by default. For example: if you forget to export translations (option expTranslations) and then import the application, you will have lost all translation mappings and all text from the translation repository. Been there, done that, not recommended :-)

Note that the API Reference states "APEXExport Utility is marked as deprecated and may be removed in a future release of Oracle APEX. Oracle recommends using Oracle SQL Developer Command Line (SQLcl) instead.".
More info in the API Reference.
For an example of using SQLcl for Apex exports, see my Backup Script page.

You may also want to look at apex_export (pl/sql) as an alternative (and very flexible) export method.

APEXExport

APEXExport usage (Apex 5.0.3):

APEXExportSplitter

APEXExportSplitter usage (Apex 5.0.3):


Idiosyncrasies

The APEXExportSplitter tool does strange things to the filenames of pages. And it does even stranger things to filenames of pages of translated applications.
Not very intuitive when trying to combine these formats with the ones you get when manually exporting pages, so I wrote two smalls Windows Powershell scripts to rename the APEXExportSplitter format. The regular expressions I used will of course work in all kinds of other tools as well.

For non-translated applications: The sql file for Page 34 of App 200 becomes "page_00020.sql". The number format used here is something like to_char(page_id,'fm00000'). When exporting the same page manually, you'll get "f200_page_34.sql".
Note that this works only for page number <= 99999. Above that the splitter utility makes a mess of it.
Powershell script:
Get-ChildItem page_*.sql | Rename-Item -NewName { $_.name -Replace '^page_+(0+)(\d+)\.sql','f200_page_$2.sql' }
For translated applications: The sql file for Page 34 of App 2001 becomes "page_3420.sql". The number format used here is something like substr(trim(page_id)||trim(app_id), 1, 4). When exporting the same page manually, you'll get "f2001_page_34.2001.sql".
Note that this works only for page number <= 9999 (1 digit less than the non-translated application). Above that the splitter utility makes a mess of it.
Powershell script:
Get-ChildItem page_*.sql | Rename-Item -NewName { $_.name -Replace '^page_(.*)2+0*1?\.sql','f2001_page_$1.2001.sql' }
Apex 5.1
This utility has been deprecated, but it still works. You can use the -split option of APEXExport instead if you want.