Export Applications and Components
The ExportApp utility lets you copy an entire application from the database to an export file in text or XML format. You can later import it from the export file into a database. The easiest method of accessing the ExportApp utility is from the Workbench Develop tab.
To export an application
1. Select the application that you want to export in the Applications portlet of the Develop tab.
2. Click File, Export.
The Export Application dialog appears.
3. Set parameters for the specified application.
4. Click Go.
Parameters for the ExportApp Utility
You can specify the following export parameters using the Export Application dialog:
Output File Format
Specifies the format of the file to be exported:
EXP
Specifies OpenROAD proprietary ASCII format
XML (-xml)
Specifies XML format
Metadata (-xmeta)
Specifies whether metadata (AlterBy, AlterDate, Creator, CreateDate) should be exported with the application. If this parameter is not set, OpenROAD assigns no metadata to the exported application. To use this parameter, you must also specify XML as the file input format.
Output File
Specifies the name of the file to which the application will be exported. By default, the name of the application is provided; overwrite this to change it. Click Browse to display a standard File Selection dialog so that you can save the file to a different location.
AppSource Only (-appsource)
Specifies that only application source information (application properties and included applications) will be included in the export file; no component information will be written to the file. Selecting this option is useful when you want to recreate an empty application from an empty export file before importing its components.
Username (-u)
Lets you use this command as if you were another user, username.
• You, not username, own all files created by OpenROAD.
• This entry field can be used only if Execute in Background is enabled.
Log Path (-L)
Specifies the name of a log file. This entry field can be used only if Execute in Background is enabled and Trace Window is set to Yes. If the log path specified is not a full path, the file is created in the ingres\files directory.
Trace Window (-T)
Lets you control display of the Trace window by entering one of the following values:
All
Specifies that the Trace window does appear
Yes
Specifies that the Trace window appears but suppresses informational messages output by the system
Yes (Minimized)
Specifies that the Trace window appears minimized as an icon
No
Specifies that the Trace window does not appear, and a log file is not created
Note: This entry field can be used only if Execute in Background is enabled.
Append to Log File (-A)
Appends the trace output of the current command to the end of the existing error log file. Otherwise, that log file is replaced. This entry field can be used only if Execute in Background is enabled.
Note: The error log file, w4gl.log, is located in %USERPROFILE%\AppData\Local\OpenROAD\Profiles\installation_ID. If the -L flag is passed, a new name and location can be provided for the OpenROAD log file.
Execute in Background
Begins a new process while you are using this utility.
If enabled, Execute in Background makes Username, Log Path, Trace Window, and Append to Log File available for use.
Note: You can set defaults for this utility using the Set Tool Defaults dialog. see
Set Defaults.
Command Line Method of Exporting an Application to a File (BackupApp)
To export an application to a file using the command line, enter the following command at the command line:
w4gldev backupapp out database application file [-appsource] [-nowindows]
[-xml [-xmeta]] [-uusername] [-Lfilename] [-vversion]
[-T{yes|yes,min|yes,logonly|all|all,min|all,logonly|no}] [-A] [-t]
For more information about including default attribute values and indenting XML elements when exporting, see Effect on File Size of Including Default Attribute Values and Indenting XML Elements.
Note: The following parameters and flags are available from the command line:
out
Specifies the export mode of the BackupApp utility
database
Specifies the name and location of the database in which the application resides
application
Specifies the name of the application to export
file
Specifies the name of the file to which the application will be exported
-appsource
Specifies that only application source information (application properties and included applications) will be included in the export file; no component information will be written to the file. Selecting this option is useful when you want to recreate an empty application from an empty export file before importing its components.
-nowindows
Lets the application run without the window manager running. This option does not provide full batch mode execution, because some interaction with the application still may be required through the Trace window.
-xml
Specifies XML format
-xmeta
Specifies whether the original XML metadata (AlterBy, AlterDate, Creator, CreateDate) is exported to the XML component file. If this parameter is not included, OpenROAD assigns new metadata to the exported component. To use this parameter, you must also specify -xml as the file output format.
-uusername
Lets you use this command as if you were another user, username.
Note: You, not username, own all files created by OpenROAD.
-Lfilename
Specifies the name of a log file. If the log path specified is not a full path, the file is created in the %II_SYSTEM%\ingres\files directory.
-vversion
Specifies the version of the application to export
-T
Controls the display of the Trace window by entering one of the following values:
yes
Specifies that the Trace window appears but suppresses all informational system messages
yes,min
Specifies that the Trace window appears minimized as an icon, and all informational system messages are suppressed
yes,logonly
Specifies that the Trace window does not appear, but all messages are saved in a log file without informational system messages
all
Specifies that the Trace window does appear and all messages are written
all,min
Specifies that messages are written to the Trace window, which appears minimized as an icon
all,logonly
Specifies that the Trace window does not appear, but all messages are saved in a log file
no
Specifies that the Trace window does not appear, and no log file is created
-A
Appends the trace output of the current command to the end of the existing error log file.
Note: The error log file, w4gl.log, is located in %II_SYSTEM%\ingres\files.
-t
Specifies that transactions are committed after each component is deleted from the database
Important! Using this parameter decreases contention and log file use. However, if your database server terminates abnormally or the BackupApp utility is aborted before completion, only some of the application components are exported.
An exit code of zero (0) means success; a non-zero exit code indicates an error.
Examples: ExportApp Utility
The following example exports the working version of all components in the “myapplication” application in the database “mydatabase” to the export file “myapp.bck” in OpenROAD text format:
w4gldev backupapp out mydatabase myapplication myapp.bck
The following example exports the working version of all components in the “myapplication” application to the export file “myapp.xml” in XML format with metadata:
w4gldev backupapp out mydatabase myapplication myapp.xml -xml -xmeta
The following example exports only application source information (no component information) to the export file “myapp.xml” in XML format without metadata:
w4gldev backupapp out mydatabase myapplication myapp.xml -appsource -xml