Subject: policy & a little help
(a)policy settings can ensure that your users only actively archive to the server. Your existing user will still be able to look at his local archive, but new documents would go to the server copy.
(b)We just moved all our users the the server. Below is a script that I put under a button that moved the user’s archive to the archive-server, then cleared their archive settings. You’ll want to adjust the server name and your email address. In addition, I later realized that the filename for the archive I moved to the server is often not the same as the deafult filename in the archive settings (recreated the next time they archive), so you’ll want to either fix that in the script or in the archive settings manually. The important thing being that they match, or you end up with them creating a new archive on the server and not seeing their existing archive on the server.
Sub Click(Source As Button)
On Error Goto quiterr
Dim session As New NotesSession
Dim uidoc As NotesUIDocument
Dim db As New NotesDatabase("","")
Dim arcdoc As notesdocument
Dim arcdoc2 As notesdocument
Dim arcfile As Variant
Dim dc As NotesDocumentCollection
Dim mymsg As String
Call db.OpenMail 'gets current user mailfile from notes.ini
Set dc = db.GetProfileDocCollection( "Archive Profile")
If Not DC.Count = 0 Then
mymsg = Cstr(dc.Count) + "profiles, "
Set arcdoc=dc.GetFirstDocument
Do Until arcdoc Is Nothing
Set arcdoc2 = dc.GetNextDocument(arcdoc)
arcfile = arcdoc.ArchivePath(0)
mymsg = mymsg + " " + arcfile
If Not arcfile="" Then
'Open archive and creates replica
Dim arcdb As New NotesDatabase("","")
Dim replica As NotesDatabase
Dim newname As String
newname = "archive\a_" & db.FileName
flag = arcdb.Open("",arcfile)
If flag = False Then
mymsg=mymsg + " no such file "
Goto quiterr
End If 'flag=""
Set replica = arcdb.CreateReplica( "yourservername", newname )
'Delete the local replica and archive profile entirely
Dim replicatest As New NotesDatabase("","") ' the replica exists,so it all worked
If replicatest.Open("yourservername",newname) Then
Call arcdoc.Remove(True)
Call arcdb.Remove
Else
Goto quiterr
End If 'replicatest
End If 'not arcfile=""
Set arcdoc = arcdoc2
Loop 'until arcdoc is nothing
Else ' If Not DC.Count = 0 Then
MYMSG = "NO ARCHIVE PROFILE"
End If 'Not DC.Count = 0 Then
'send a message to me so I know it finished
Set msgdoc = New notesDocument(db)
msgdoc.Form = "Memo"
msgdoc.Subject = "Archive Move COMPLETE"
msgdoc.Body =("Completed moving archives for this user." + mymsg)
msgdoc.SendTo = "Your Name/yourorg" Call msgdoc.Send( False )
'DONE
Messagebox("Your archive(s) have been moved to the server. Thank you!")
Exit Sub
quiterr:
Set msgdoc = New notesDocument(db)
msgdoc.Form = "Memo"
msgdoc.Subject = "Archive Move ERROR"
msgdoc.Body =("ERROR moving archives for this user." + mymsg)
msgdoc.SendTo = "Your Name/yourorg"
Call msgdoc.Send( False )
Messagebox("Thank you for participating.")
Exit Sub
End Sub