If you forget the directory manager password, it’s pretty easy to reset it. You will have to edit the main server config file (dse.ldif). Before you do that, you must shutdown the server. If the server is running and you edit dse.ldif, your changes will be lost.
Next, generate the new password using the pwdhash command.
This will print out the hashed password string using the default directory manager password hashing scheme for your instance (SSHA by default). Then
Edit dse.ldif (you should have already shutdown the server - see above) - search for nsslapd-rootpw - you will see a line like this:
Replace the value with the value printed out by pwdhash and save the file. Then restart the server
Then test your new password
ldapsearch -x -D "cn=directory manager" -w newpassword -s base -b "" "objectclass=*"