What I have in mind is the combinations of three options in slapdadd.
slapadd -p : promote : if syncrepl%d entries are found
(consumer->provider)
find maximum cookie value out
of
the syncreplCookie stored in them,
and create an ldapsync entry
containing the maximum cookie value.
do not add the syncrepl%d
entries in the provider replica.
else if ldapsync entry is found
(provider->provider)
add it to the provider replica
as is.
slapadd -r : demote : if ldapsync entry is found (provider->consumer)
create syncrepl%d entries having
the contextCSN stored in the ldapsync entry.
else if syncrepl%d entries are found
(consumer->consumer)
add them to the consumer replica
as is.
-w : if -w option is used in addition to -p / -r,
slapadd will recalculate the contextCSN and
syncreplCookie in the
ldapsync and syncrepl%d entries respectively,
based on the entryCSN of the entries.
(hard to find appropriate letters left available in the slaptool
options...)