If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Automating the Synchronization Process

This topic describes how to create a batch file and a Windows Scheduled Task that will automatically run the Object Repository Synchronizer utility on a specified schedule.

When you run AptifyObjRepSynchronizer.exe, a dialog opens that walks you through the process for downloading objects. However, the Object Repository Synchronizer also supports a series command line arguments. Specifying a series of arguments on a command line suppresses the dialog and runs the tool in the background. The command line arguments are as follows (and shown below):


Synchronizer Command Line Arguments

  • /? or /Help: Displays the help screen shown above.
  • /Server=[Aptify Database Server]: Use this argument to specify the Aptify database server. Note that rather than use this command line argument, you can add the Aptify.Framework.LoginServices.AptifyLogin.Server key to the AptifyObjRepSynchronizer.exe.config file.
  • /EntitiesDB=[Database used to store Aptify's Entities Entity]: Typically, this database is APTIFY, which is already set in AptifyObjRepSynchronizer by default. Therefore, you do not need to use this command unless you have installed Aptify to a database other than APTIFY.
  • /UsersDB=[Database used to store user metadata]: Typically, this database is APTIFY, which is already set in AptifyObjRepSynchronizer by default. Therefore, you do not need to use this command unless you have installed Aptify to a database other than APTIFY.
  • /User=[Untrusted User Name]: If connecting as an untrusted user, such as sa, use this argument to specify that user. There is no command line argument to specify a trusted user account. Instead, set the Aptify.Framework.LoginServices.AptifyLogin.Trusted key to true in the AptifyObjRepSynchronizer.exe.config file to use a trusted login.
  • /pwd=[password]: If you specified an untrusted user using the /user -argument, specify the password for that untrusted user. Note that the password will appear in plain text. There is no command line argument to specify a trusted user account. Instead, set the Aptify.Framework.LoginServices.AptifyLogin.Trusted key to true in the AptifyObjRepSynchronizer.exe.config file to use a trusted login.
  • /CacheFolder=["Aptify Folder Location"]: The path for the Object Cache folder, for example, in an e-Business environment, C:\inetpub\wwwroot\ebusiness\bin. When using this argument, enclose the path in quotation marks.
  • /RepositoryUserID=[ID of User]: Use this argument to specify the ID of the user for whom the synchronization utility runs. (This is the equivalent to the Repository User selection you would make in the tool's user interface.)
  • /s: This argument suppresses the synchronizer's user interface.
  • /c: This argument, specifies the Sync Repository Objects record that contains the collection of objects to download (or not download). With this option, only the objects within the Sync Repository Objects record that are marked as Downloadable will be downloaded. See Creating a List of Objects to Download for more details.

By using the command line arguments listed above and modifying the AptifyObjRepSynchronizer.exe.config file, you can create a batch file and a Windows Scheduled Task that automatically stops any applicable services, runs the synchronization utility, and restarts the services on a pre-determined schedule without requiring user intervention.

 

 When specifying multiple command line arguments, separate each argument with a space.

Example: Automating the Synchronization Process for an e-Business Web Server

The procedure below describes how to create a scheduled task on an e-Business web server to automate the execution of the synchronizer using a trusted user account (the user specified in the Scheduled Task).

  1. Log in to the web server using a Windows account that is an administrative user on the computer (i.e., the user is in the computer's Administrators group).
  2. Identify the location of the Object Repository Synchronization Utility on the computer. See Running the Object Repository Synchronizer.
  3. Open the AptifyObjRepSynchronizer.exe.config file with Notepad.
  4. Locate the Aptify.Framework.LoginServices.AptifyLogin.Trusted key and change the value from false to true.
    • With this setting, the synchronizer uses the trusted user account for the Windows domain user specified in the Scheduled Task. This eliminates the need to use the /User and /pwd command line arguments.
       
  5. Add the following line above the Aptify.Framework.LoginServices.AptifyLogin.Trusted key to connect to your organization's Aptify database server only:

    <add key="Aptify.Framework.LoginServices.AptifyLogin.Server" value="[Enter Your Database Name]"/>

    Modifying Synchronizer Config File 
    • This eliminates the need to use the /Server command line argument.  
       
  6. Save and close AptifyObjRepSynchronizer.exe.config.
  7. Create a batch file that performs these steps:
    • Stops any applicable services using the NET STOP "[service name]" command as required by your network. However, do not stop the Aptify Object Repository Service, since the Synchronizer uses this service.

      You do not need to stop and restart Microsoft IIS. IIS 6.0 and higher recognizes the updates automatically and cycles any new components into use.

    • Run the synchronization utility for a specified repository user in silent mode with this command: "[file path]\AptifyObjRepSynchronizer.exe" /s /CacheFolder="[Location of Aptify Files]" /RepositoryUserID=[UserID]

      For example:
      "C:\Synchronizer\AptifyObjRepSynchronizer.exe" /s /CacheFolder=-"C:\Inetpub\wwwroot\ebusiness\bin" /RepositoryUserID=24
       
    • In general, specify the same user that you would select if you were to run the tool manually. Be sure to include the quotation marks as specified.
    • Note that if you configured AptifyObjRepSynchronizer.exe.config to specify a server and a trusted user, you only need to specify the /s, /CacheFolder, and /RepositoryUserID command line arguments.
    • Start any services that you stopped using the NET START "[service name]" command.
       
  8. Click Start > Control Panel > Scheduled Tasks > Add Scheduled Task to open the Scheduled Task Wizard.
  9. Click Next at the Welcome screen to continue.
  10. In the Click the program you want to run screen, click the Browse button, locate the batch file you created (such as synchronize.bat), and double-click it.

    Configure Task Frequency
     
  11. Select the frequency for the task, and click Next.  
  12. Complete the task's schedule information, and click Next. Note: To prevent any disruption of website activity, you should run the Object Repository Synchronizer after hours or at a time when the site is not available.
  13. Enter the user name and password for the trusted administrative user who will run this task, and click Next.
    • Typically, this is the e-Business user, which is responsible for running the e-Business site.  

      Configure Task User Information
       
  14. Click Finish to create the Scheduled Task. The Scheduled Task will execute at the interval you specified and run your batch file.

Copyright © 2014-2017 Aptify - Confidential and Proprietary