PingDirectory

Synchronize a specific list of database elements

About this task

The resync command enables synchronizing a specific set of database keys that are read from a Java database connectivity (JDBC) Sync Source file using the --sourceInputFile option. The contents of the file are passed line-by-line into the listAllEntries() method of the JDBCSyncSource extension, which is used for the Sync Pipe. The method processes the input and returns DatabaseChangeRecord instances based on the input from the file.

Perform the following steps to synchronize a specific list of database elements using the resync command:

Steps

  1. Create a file of JDBC Sync Source elements. There is no set format for the file, but it typically contains a list of primary keys or SQL queries. For example, create a file containing a list of primary keys and save it as sourceSQL.txt.

    user.0
    user.1
    user.2
    user.3
  2. Run the resync command with the --sourceInputFile option to run on individual primary keys in the file.

    $ bin/resync --pipe-name "dbsync-pipe" \
    --sourceInputFile sourceSQL.txt
  3. If searching for a specific type of database entry, use the --entryType option that matches one of the configured entry types in the JDBCSyncSource.

    $ bin/resync --pipe-name "dbsync-pipe" \
    --entryType account \
    --sourceInputFile sourceSQL.txt