PingDirectory

Importing data

After installing the database, such as userRoot, import data into the database.

Steps

  • To add a server to a replicating set:

    1. Perform a dsreplication enable operation.

    2. Import the database through the dsreplication initialize operation.

  • To add a server to a non-replicating set or to add the first server of a future replicating set, import the data with the bin/import-ldif tool.

    For more information about the bin/import-ldif tool, see Importing and exporting data.

Generating sample data

The PingDirectory server provides LDIF templates to generate sample entries for initializing your server. You can generate the sample data with the make-ldif utility together with template files that come bundled with the .zip build, or you can use template files that you create yourself.

About this task

The templates create sequential entries for testing the PingDirectory server with a range of dataset sizes. The templates are located in the config/MakeLDIF.

The sample data templates generate a dataset with basic access control privileges that grants anonymous read access to anyone, grants users the ability to modify their own accounts, and grants the admin account full privileges. The templates also include the uid=admin and ou=People entries.

Steps

  • To generate randomized sample data, use the --randomSeed option with the make-ldif command.

    Example:

    $ bin/make-ldif --templateFile config/MakeLDIF/example-10k.template \
      --ldifFile /path/to/data.ldif --randomSeed 0

    If the --randomSeed option is used with the same seed value, the template always generates the same .ldif file.

    Result:

    The command generates 10,000 sample entries and writes them to an output file, data.ldif. The random seed generator is set to 0.

  • To bypass the make-ldif command, use the --templateFile option with the import-ldif tool.

Importing data on the PingDirectory server using offline import

Steps

  1. Create a .ldif file that contains entries or locate an existing file.The import-ldif tool requires a .ldif file, which conforms to standard LDIF syntax without change records. The changeType attribute is not allowed in the input LDIF. For information on adding entries to the PingDirectory server, see Managing Entries.

  2. Stop the PingDirectory server.

  3. To import data from an LDIF file to the PingDirectory server, use the import-ldif command.

    For assistance with the list of options, run import-ldif --help.

    In the following example, the data is imported from the data.ldif file to the userRoot backend. Entries rejected because of schema violation are written with the rejection reason to the rejects.ldif file. Skipped entries, written to skipped.ldif, occur if an entry cannot be placed under a branch node in the directory information tree (DIT) or if exclusion filters, such as --excludeBranch, --excludeAttribute, or --excludeFilter are used. The--overwrite option instructs import-ldif to overwrite existing skipped and rejected files. The --overwriteExistingEntries option indicates that any existing data in the backend should be overwritten, and the --stripTrailingSpaces option strips trailing spaces on attributes that would otherwise result in an LDIF parsing error.

    Example:

    $ bin/import-ldif --backendID userRoot --ldifFile /path/to/data.ldif --rejectFile
        rejects.ldif --skipFile skipped.ldif --overwrite --overwriteExistingEntries --stripTrailingSpaces
  4. Restart the PingDirectory server.