Setting up the WebSphere Commerce configuration file synchronization Ant script

Developers of a customization project often manually edit the WebSphere Commerce configuration file wc-server.xml outside of the Configuration Manager and check it into the repository.

While it may be convenient, it also makes the master copy of the file on the WebSphere Commerce server (the WC_installdir/instances/instance_name/xml/instance_name.xml file) lose synchronization with the copy in the WebSphere Commerce EAR. One version can potentially overwrite the other if a different update method is used.

Note: If you are not changing the WebSphere Commerce configuration file, you may skip this section.

If the file transfer protocol used in your customization project is not one to which sample scripts are provided, you must develop custom scripts as per process described in the Customizing the server deployment process topic.

About this task

As a best practice, the files must be synchronized, and the WebSphere Commerce Build and Deployment tool supports this practice by transferring the wc-server.xml file that is in the server deployment package to the WebSphere Commerce server. In order to support remote servers that may have different file transfer methods, the server deployment scripts require users to provide a WebSphere Commerce configuration file synchronization Ant build file that is run as part of the server deployment process.

Sample scripts for some popular file transfer protocols are provided by default in the WCBD_deploy_server_dir/wc-server-sync directory, including:

File transfer protocols Directory
FTP wcbd-sample-wc-server-sync-ftp.*
Local filesystem wcbd-sample-wc-server-sync-local.*
SCP or SFTP wcbd-sample-wc-server-sync-scp.*
Note: protocol refers to one of ftp, local or scp that suits your environment.

Procedure

  1. If WCBD_deploy_server_dir/wc-server-sync/wcbd-sample-wc-server-sync-protocol.private.properties exists, copy the file as WCBD_deploy_server_dir/wc-server-sync-protocol.private.properties.
  2. Copy WCBD_deploy_server_dir/wc-server-sync/wcbd-sample-wc-server-sync-protocol.properties as WCBD_deploy_server_dir/wc-server-sync-protocol.properties.
  3. Copy WCBD_deploy_server_dir/wc-server-sync/wcbd-sample-wc-server-sync-protocol.xml as WCBD_deploy_server_dir/wc-server-sync-protocol.xml.
  4. LinuxAIXFor IBM i OS operating system Change the file permission with the following commands:
     chmod 755 WCBD_deploy_server_dir/wc-server-sync-protocol.*
  5. Open WCBD_deploy_server_dir/wc-server-sync-protocol.xml with a text editor and replace the name attribute of the root project element from wcbd-sample-wc-server-sync-protocol to wc-server-sync-protocol . For example, if the file transfer protocol is FTP, then WCBD_deploy_server_dir/wc-server-sync-ftp.xml should have the following line:
    <project name="wcbd-sample-wc-server-sync-ftp" default="all">
    changed to:
    <project name="wc-server-sync-ftp" default="all">
  6. If step 1 is applicable, open WCBD_deploy_server_dir/wc-server-sync-protocol.private.properties with a text editor and edit the properties according to the comments in the file. Properties in this file will be encoded when the deployment process is run.
  7. Open WCBD_deploy_server_dir/wc-server-sync-protocol.properties with a text editor and edit the properties according to the comments in the file.