bfexport reference

Use the bfexport command to export project data to a named XML file or to send project data to the display terminal (stdout) for viewing. An export file contains project configuration data for a single project or project snapshot.

Syntax

bfexport

bfexport [-l]

bfexport [-l] <project_name>
bfexport [-c "<comment>"] [-f <file_name>] [-g] [-s] [-C] [-L ] [-n ] 
<project_name> | <project_name> <snapshot_name> | <project_id>

Usage

To complete common project export tasks, use these command options:
  • To display command syntax, use bfexport with no options.
  • To list the project names and project IDs that are stored in the Build Forge database, use bfexport -l.

    Snapshot names are appended to the project name in the command output: <project_ID>: <project_name> – <snapshot_name>

  • To send project data to an XML file, bfexport -f <file_name>. You must specify the -f <file_name> option to generate a file that can be used to import project data.
  • On the z/Linux platform, you must run the command as bfexport.pl. On all other platforms, the command does not require an extension.

Prerequisites and restrictions

Find the bfexport utility in your Build Forge installation directory.

Server authorization passwords for servers are not included in the export file; after import, you must manually enter server authorization passwords in the UI.

The bfexport command must be able to find the buildforge.conf file and access the Build Forge database. Run bfexport from the directory where buildforge.conf is located, which is in <bfinstall> on Windows and in <bfinstall>/Platform on UNIX and Linux.

Examples

To write output to a file, use the -f <file_name> option. In the following example, helloworld is the output file name and the project ID is used instead of the project name.

bfexport -c "Saving a copy of project before making changes" 
 -f helloworld 675B57CC-8366-11DD-B2E0-043C04E44E1A

To export the default project snapshot only, use the <project_name>.

bfexport -f helloworld test_project

To export one snapshot of a project, use the <project_name> <snapshot_name>.

bfexport -f helloworld test_project snapshot_1

If the parent project snapshot is not the default project, you must specify the <project_name> followed by the parent keyword to export the parent project snapshot.

bfexport -f helloworld test_project parent

Option descriptions

Option Description
<project_name> The name of the project to export. The project name or the project ID is required. If the project name contains spaces, you must quote the name.

Specify the project name after the command options.

<snapshot_name> The name of the project snapshot to export; the project name is required, as shown in the following syntax:
<project_name> <snapshot_name>

Specify the project name and snapshot name after the command options. If the project or snapshot name contains spaces, you must quote the name.

<project_id> The identifier for the project to export. The project ID is a UUID. The project ID or project name is required.

Specify the project ID after the command options.

-f <file_name> An XML file name for bfexport output. If you do not provide a path name, the current working directory is used. If the file name contains spaces, you must quote the name.

If you do not provide a file name, bfexport output is sent to stdout.

Note: Use stdout for viewing only. Do not redirect stdout to a file; the resulting file includes logging messages and cannot be used as an import file for the bfimport command or the UI import utility.
parent A keyword that is required to export a parent project snapshot if the parent is not the default project snapshot.

Specify the parent keyword after the project snapshot name:

bfexport -f helloworld test_project parent
-l Lists the projects in the database by name and project ID. You cannot use the -l option with other options.
-c "<comment>" Includes a comment. You must quote the comment (for example, "my project version 50"). The comment is added to the <buildforge> XML element.
-g Saves to the XML file the users who are members of the access groups designated to receive notifications. Users and their properties are listed in the <user> XML element. Requires -s.
-s Saves to the XML file the servers defined in the Management Console. Servers and their properties are listed in the <server> XML element, along with any associated <auth> and <collector> information.
-L Saves to the XML file the LDAP domain controllers defined in the UI. LDAP domain controllers and their properties are listed in the <ldap> XML element.
-n Saves to the XML file the notification templates assigned to the project and steps. The notification templates and their properties are listed in the <mail-template> XML element.
-C Saves to the XML file the collectors assigned to the servers for the project. Collectors and their properties are listed in the <collector> XML element. Requires -s.

Troubleshooting

If you encounter errors that report files or libraries cannot be found, be sure that the library path is set correctly.
  • LD_LIBRARY_PATH on Linux systems and UNIX systems.
  • LIBPATH on AIX systems.

The correct settings are in <bfinstall>/rc/buildforge. Check the library path variable and other variables set in that file. Reset them as necessary, then export them.