Restore Folders in a mailfile from a Tape

Is their an easy way to restore a few folders for a user mailfile from tape.

For instance, a user deletes a folder by mistake in their mail file.

Currently, I restore the users mail file from tape backup, to a restore directory on the users mail server. I then open both mail files and then re-create the deleted folder manually in the users production mailfile in the domino data mail directory. I then open the mail file from the restore directory and copy all the contents of the deleted folder to the contents of the re-created folder in the domino data mail directory.

This obviuosly, creates duplicate messages in ALL DOCUMENTS, since I am doing a copy &from the restore mail file and a paste to the production mail file.

Is their a better way to restore a folders and its content ?

Thanks…

Subject: Restore Folders in a mailfile from a Tape

I wrote some script (quick & dirty) that loops through all folders in the restored db. Then it loops through all the documents in the folder, gets the DocUniqueID an looks if he can find the same DocUniqueID in the active Mail-DB.If yes, he will put it in the same folder as in the restored db.

Data for server name and replica ID is taken from a small setup document. The script is in a button in the setup-doc.

Here is the code:

Sub Click(Source As Button)

'Basisdeklarationen

Dim uiws As New NotesUIWorkspace

'Objektdeklarationen

Dim sourcedb As NotesDatabase

Dim sourcedoc As NotesDocument

Dim sourceview As NotesView

Dim targetdb As NotesDatabase

Dim targetdoc As NotesDocument

Dim uidoc As NotesUIDocument

'Variablendeklarationen

Dim docunid As String

Dim foldername As String

Dim message As String

Dim sourcedbid As String

Dim sourcedbserver As String

Dim targetdbid As String

Dim targetdbserver As String

'Startwerte setzen

Set uidoc = uiws.CurrentDocument

'Verbindungsdaten auslesen

sourcedbserver = uidoc.FieldGetText("Ft_SourceDBServer")

sourcedbid = uidoc.FieldGetText("Ft_SourceDBID")

targetdbserver = uidoc.FieldGetText("Ft_TargetDBServer")

targetdbid = uidoc.FieldGetText("Ft_TargetDBID")

'Erstmal den Doppelpunkt aus den Replik-IDs filtern

sourcedbid = Left$(sourcedbid,8)+Right$(sourcedbid,8)

targetdbid = Left$(targetdbid,8)+Right$(targetdbid,8)

'Quell-DB öffnen

Set sourcedb = New NotesDatabase("","")

If Not sourcedb.OpenByReplicaID(sourcedbserver,sourcedbid) Then

	message = "Quelldatenbank konnte nicht geöffnet werden"

	Messagebox message,16,"Fehler"

	Exit Sub

End If

'Ziel-DB öffnen

Set targetdb = New NotesDatabase("","")

If Not targetdb.OpenByReplicaID(targetdbserver,targetdbid) Then

	message = "Zieldatenbank konnte nicht geöffnet werden"

	Messagebox message,16,"Fehler"

	Exit Sub

End If

'Loop durch alle Ansichten in der Quell-DB

Forall v In sourcedb.Views

	If v.IsFolder Then

		foldername = v.Name

		Set sourcedoc = v.GetFirstDocument

		'Loop durch alle Dokumente im Folder

		Do While Not sourcedoc Is Nothing

			docunid = sourcedoc.UniversalID								'DocUniqueID auslesen

			Set targetdoc = targetdb.GetDocumentByUNID(docunid)		'Gegenstück in der Zieldatenbank finden

			If Not targetdoc Is Nothing Then

				Call targetdoc.PutInFolder(foldername)

			End If

			Set sourcedoc = v.GetNextDocument(sourcedoc)

		Loop

	End If

End Forall

End Sub