If you are upgrading a Directory Server version prior to 7.3 to version 7.3 or later and at least one server was previously removed from the topology, you may receive an error message similar to one of the following:
[09/Dec/2019:18:37:56.927 -0700] instanceName="[INSTANCE_NAME]" \
				threadID=438 category=REPLICATION severity=NOTICE msgID=118947975 msg="The \
				replication total backlog count is 163364"
[09/Dec/2019:17:15:10.108 -0700] category=REPLICATION \
			severity=SEVERE_ERROR msgID=14942295 msg="While clearing the database 997 \
			o=mycompany, the following error happened: (JE 7.5.12) Attempted to remove \
			non-existent database 997 o=mycompany DatabaseNotFoundException: (JE 7.5.12) \
			Attempted to remove non-existent database 997 o=pingone (DbTree.java:922 \
			DbTree.java:1183 DbTree.java:1235 Environment.java:1001 Environment.java:1221 \
			Environment.java:1204 Environment.java:1009 ReplicationDbEnv.java:1186 \
			DomainDbEnv.java:995 ReplicationDB.java:1002 DbHandler.java:1324 DbHandler.java:1064 \
			DbHandler.java:1042 DbHandler.java:798 DbHandler.java:723 DirectoryThread.java:352 \

Perform the following steps to restore a mixed-version 6.2 - 7.x topology with replication problems to a clean state with all servers at the same level and with replication functioningnormally:

  1. Run bin/export-ldif on the primary server to export a safe copy of the data.
  2. Start the downlevel primary server and stop the upgraded replica server.
  3. Run bin/remove-defunct-server on the upgraded replica server and do the following at the command prompts:
    • Select the replica server itself.
    • Supply the credentials for the primary server when prompted.
    • Select [c] to continue.
    • Enter the path to the local changelogDB when prompted
  4. Leave the upgraded replica server stopped and stop the downlevel primary server.
  5. Run bin/dsreplication on the primary server and do the following:
    • Select 2) Manage the topology (add and remove servers).
    • Select 4) Cleanup Server.
    • Select [c] to continue.
    • Enter the path to the local changelogDB when prompted.
  6. Start the downlevel primary server and the upgraded replica server.
  7. Run bin/status on both servers and verify Replication: disabled under Data Sources.
  8. IMPORTANT: Upgrade the replica server to version or later (which contains fixes for issues 00668265 and DS-40955).
  9. Upgrade the primary server to the same level as the replica server.
  10. Re-enable replication between primary and replica server using the bin/dsreplication tool.
  11. Re-initialize the replica server data from the primary server.
  12. Run bin/status on both servers to verify that replication is enabled under Data Sources and that both servers show the same number of entries.