Importing data
After installing the database, such as userRoot, import data into the database.
Steps
-
To add a server to a replicating set:
-
Perform a
dsreplication enableoperation. -
Import the database through the
dsreplication initializeoperation.
-
-
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-ldiftool.For more information about the
bin/import-ldiftool, 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
--randomSeedoption with themake-ldifcommand.Example:
$ bin/make-ldif --templateFile config/MakeLDIF/example-10k.template \ --ldifFile /path/to/data.ldif --randomSeed 0If the
--randomSeedoption is used with the same seed value, the template always generates the same.ldiffile.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-ldifcommand, use the--templateFileoption with theimport-ldiftool.
Importing data on the PingDirectory server using offline import
Steps
-
Create a
.ldiffile that contains entries or locate an existing file.Theimport-ldiftool requires a.ldiffile, which conforms to standard LDIF syntax without change records. ThechangeTypeattribute is not allowed in the input LDIF. For information on adding entries to the PingDirectory server, see Managing Entries. -
Stop the PingDirectory server.
-
To import data from an LDIF file to the PingDirectory server, use the
import-ldifcommand.For assistance with the list of options, run
import-ldif --help.In the following example, the data is imported from the
data.ldiffile to theuserRootbackend. Entries rejected because of schema violation are written with the rejection reason to therejects.ldiffile. Skipped entries, written toskipped.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--excludeFilterare used. The--overwriteoption instructsimport-ldifto overwrite existing skipped and rejected files. The--overwriteExistingEntriesoption indicates that any existing data in the backend should be overwritten, and the--stripTrailingSpacesoption 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 -
Restart the PingDirectory server.