Copy more than 4 Lakhs document from one database to another

Hi,

I want to copy 4 lakhs document form one database to another. I have written a code snippet as given below but. After copying 2 lakhs document lotus got crashed.

Please let me know if i can do it throughy any other way.

Thanks In Advance.

CODE =>

Dim S As New NotesSession

Dim Db As NotesDatabase

Dim Doc As NotesDocument

Dim vw As NotesView, vc As NotesViewEntryCollection	



Set Db = S. CurrentDatabase

Set vw = Db.GetView("all")

lendbpath% = Len(db.FilePath)

dblen% = Len(db.FileName)	

currdirlen%=lendbpath% - dblen%

currdir$=Left(db.filepath, currdirlen%)+"ArchMsgDB.nsf"	

Dim ArchiveDB As New NotesDatabase(db.server,currdir$)



Set Doc = vw.GetFirstDocument

While Not Doc Is Nothing		

	Call Doc.CopyToDatabase(ArchiveDb)				

	Set Doc = vw.GetNextDocument(Doc)	

Wend

Eagerly waiting for Reply

Thanks Again,

Ranjan

Subject: Copy more than 4 Lakhs document from one database to another.

FYI: Many people may not know what a Lakh is.

Wikipedia: A lakh (also written lac) is a unit in the Indian numbering system equal to one hundred thousand (100,000; 105). It is widely used both in official and other contexts in Bangladesh, India, Nepal, Sri Lanka, Myanmar and Pakistan, and is often used in Indian English.

Subject: Copy more than 4 Lakhs document from one database to another.

Hi Ranjan,

for me it looks more like a problem of notes than of your code.

But you could try the following:

set the view’s Property vw.AutoUpdate=false before looping through its documents. This should at least enhance the performance of your script.

HTH,

Marco

Subject: RE: Copy more than 4 Lakhs document from one database to another.

Thanks Marco for help.

I will let u know what the actual problem is…

We have scheduled this agent. After copying 2 lacs documents lotus notes got crashed.

I think yours solution will work.

if u have any further info on this please give your thoughts.

Thnx a lot Marco

Ranjan