Tip to delete 1 million documents from replica

Hi

I need to remove abbout 1 million documents from a database. What is the fastest and safest way to do this? The documents are very simple, only 4 text fields.

Regards

Subject: Tip to delete 1 million documents from replica

Depending on your environment, it may be possible to create a new database and replica with no documents.

Subject: Tip to delete 1 million documents from replica

Well, if it were me, I’d get them in a NotesDocumentCollection and then use the RemoveAll method. And I’d do this in an agent running on the server. There are plenty of other ways. But whatever you end up using, I would definitely make sure to run it on the server rather than from a client.

Subject: RE: Tip to delete 1 million documents from replica

Running it at night will lower the impacts on your users. You will have to update your view index. You should run a program document (Updall) to update them.

JYR

Subject: Tip to delete 1 million documents from replica

Removing them all at once could cause issues with your ft/view indexes.

A scheduled agent that runs every ~60 minutes and tears out ~50k of them would be my approach.

Subject: RE: Tip to delete 1 million documents from replica

AMEN to everything Timothy said! How do you eat an elephant? – ONE BITE at a time! If I had a million documents to delete (gasp!) I’d take them out in batches too – but overnight, not during business hours.

Trish

Subject: RE: Tip to delete 1 million documents from replica

It wouldn’t do anything funky with the Full Text Index. The only issue there is that the search keys would still remain in the FT index. So it would be larger then needed.

The quickest way I’d do it is.

  1. Create a new replica locally to my machine.

  2. Nuke the records and rebuild the view indexes.

  3. OS copy the database back to the server (needs server to be down).

  4. Delete the full text index and recreate it.

This would mean the least amount of time for other users and your taking away any server performance issues and any mistakes from the production server.

Subject: Tip to delete 1 million documents from replica

If you can easily specify these documents - e.g. all with form “fred” or all where field “jim” is zero, then create a new replica locally or on another server, with a replication formula set to exclude those docsOnce it has replicated, you can delete the original, then replicate the slimmed down db back

Subject: … and of course …

… doing things this way won’t shaft the server and will affect you users hardly at all