Lotus Script to backup mails

Dear All,

Our lotus notes setup here at work does not allow the archiving to work (don't ask! Its not that we are not allowed it just does not work!) however we can use a simple command scripts to Copy documents that are more than 7 days old into a network backup database and the delete those from your main mailbox.

Using the simple commands I have done this and it works but with one problem, when a calendar entry is copied over to the backup database it removes it from my live calender and appears in the calendar for the backup mailfile. Is there a lotusscript method that will do the same as my simple actions agent but leave calender entrys and invites alone?

Many thanks,

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sjef BosmanGroupware ConsultantCommented:
Does not work??? I'm inclined to say (as SuperNanny does): "unasseptable!". What doesn't work? IMHO recreating the archive functionality that works for thousands of people is bound to fail and it will cost too much.

What systems are you on, and what versions of Notes/Domino do you use? Where did you try to create the archive, locally?

Similar questions about archiving:
    http:Q_21129164.html "Archive Failing"
    http:Q_20571664.html "Archiving A Database"
kevinsmith121Author Commented:
Oh I agree totally sjef bosman, sadly I have no control over the fact that this feature is broken, it has been that way for years.

mbonaci thankyou for the links but sadly I am an idiot and may need a little more guidence.

Does anyone have code I can copy and paste and just fill in the blanks for the mailfile names and locations?

Conditions are that I want to export from DatabaseA to DatabaseB all document older than 7 days but do not move Invitations and Calender entries.

Cheers chaps

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

OK, I'll help you, give me ten minutes.

Sjef BosmanGroupware ConsultantCommented:
LOL Please read the monkey-story in my EE-profile.

You must have had some Domino/Notes upgrade over those years? Full of unbroken or mended features?

Additional links, describing or containing agents:
    http:Q_20586136.html "Archive to selected date"
    http:Q_21140062.html "Archive old documents from a production database."
Sjef BosmanGroupware ConsultantCommented:
LOL Too late... ;)
kevinsmith121Author Commented:
LOL the Monkey Story is spot on!!

all this we'll do in your mail db (preferably create your own mail template and do the modifications on it. After you're done replace the design of your mail file with that template.)

First create new view called OlderThenWeek.
Selection formula:
Dat := @Adjust( @Today; 0; 0; -7; 0; 0; 0 );
Select @IsMember( Form; "Memo" : "Reply" ) & @Created < Dat

Then create new agent with this in Initialize event:

Sub Initialize
    Dim s As New NotesSession
    Dim dbSource As NotesDatabase, dbDest As NotesDatabase
    Dim source As NotesView
    Dim vc As NotesViewEntryCollection
    Dim ve As NotesViewEntry, tmpve As NotesViewEntry
    Dim rez(1) As String
    rez(0) = "<DestinationServerName>"
    rez(1) = "<DestinationFilePathRelativeToData>"
    Set dbSource = s.CurrentDatabase
    Set source = dbSource.GetView( "OlderThenWeek" )
    Set vc = source.AllEntries
    Set dbDest = s.GetDatabase( rez(0), rez(1), False )
    Set ve = vc.GetFirstEntry
    Do Until ve Is Nothing
        Call ve.Document.CopyToDatabase( dbDest )
        Set tmpve = ve
        Set ve = vc.GetNextEntry( ve )
        Call tmpve.Document.Remove( True )
End Sub

You can schedule the agent or make it run after agent list selection.
As Target specify All documents in a database.

Hope this helps,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I've found different archiving methods work better over others.  We set our to only archive selected documents and then you just select what you want to archive and select 'archive selected documents' instead of 'archive now'.  There archive feature is rather flakey.  Try some different setups w/ it, maybe it will work, thats probably your best bet.

You could also modify your design and just add a simple agent that would run from the menu.  If you use simple functions, its real easy!!  Just have on command to copy to a db, then on to delete.  Set it up to work on selected documents only or maybe you can do a selection on age there but not sure on that!
kevinsmith121Author Commented:
Many thanks mbonaci, spot on advice!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.