Moving APEX Applications Between Environments
Every APEX development team needs a reliable process for moving applications from development to test to production. APEX’s export and import mechanism is the foundation of this process. Understanding the options and best practices prevents deployment headaches and data loss.
Full Application Export
Export your application from App Builder using the Export/Import menu. Choose “Application Export” for a complete SQL file that recreates the entire application. Key export options to consider:
Export As: Choose “Application Export” for a single file. For version control, choose “Split Application Export” which creates a directory structure with separate files for each page, shared component, and setting. The split format works well with Git.
File Format: SQL is the standard. YAML export (available in recent APEX versions) is more diff-friendly for version control.
Supporting Objects: Include supporting objects if your application depends on database objects (tables, packages, sequences) that should be created during import. Define installation and deinstallation scripts in Shared Components under Supporting Objects.
Command Line Export With SQLcl
For automated deployments, use SQLcl or the APEX_EXPORT PL/SQL API rather than the web interface:
-- SQLcl command line export
apex export 100 -dir /exports -split
-- PL/SQL API export
DECLARE
l_files APEX_T_EXPORT_FILES;
BEGIN
l_files := APEX_EXPORT.GET_APPLICATION(
p_application_id => 100,
p_split => TRUE
);
-- Write files to directory or CLOB table
END;
Import Strategies
For the target environment, import through App Builder’s Import wizard or through SQLcl. Critical import settings include the target workspace, parsing schema, and whether to keep or reassign the application ID. For production deployments, always import into the same application ID to preserve bookmarks and external integrations.
Handling Data and Configuration
APEX exports include the application definition but not application data. If your application relies on configuration data (lookup tables, system settings), export and import that data separately using INSERT scripts or Data Pump. Include these scripts in your Supporting Objects so they run automatically during import.
Version Control Integration
Use the split export format and commit it to Git after every significant change. This lets you track who changed what, diff between versions, and roll back if needed. Create a deployment script that imports the application from the Git repository, runs any database migration scripts, and validates the deployment. Automate this with CI/CD tools for consistent, repeatable deployments.