Automatic means a scheduled agent. The easiest thing to do is write a daily LS agent that goes over all docs in a view that lists only completed docs and moves them.
Sample code for that would be like this :
Code:
dim session as new notessession
dim db as notesdatabase
dim arcdb as notesdatabase
dim view as notesview
dim doc as notesdocument
dim movedoc as notesdocument
dim flag as integer
set db = session.currentdatabase
set arcdb = session.getdatabase(db.server,<arcdb filepath>)
if arcdb.isopen then 'checks that the archive is available
set view = db.getview(<view name>)
set doc = view.getfirstdocument
do while not doc is nothing
set movedoc = doc.copytodatabase(arcdb)
flag = doc.remove(false)
delete movedoc
set doc = view.getfirstdocument
loop
end if
This code opens the current db, then opens the archive db and checks to see that it is available. If not, end of code (you can devise an error message here with Print, it writes to the server log database).
If all is well, the code goes on to open the view which lists all finished docs. Set the view up with the appropriate selection formula. Does wonders to save on coding for all docs in the database.
Once the first doc is loaded, the fun starts.
For each doc, a copy is created in the archive db.
Then the original is deleted. You can use flag to check if the deletion has been done correctly. If not, be aware that the code will once again load that doc to delete, so you need to think about what you can do (error message and exit the code, for example).
If all goes well, a new first document is loaded. This has to be done this way because the method getnextdocument has nothing to work on once the original is deleted. No problem, since the view updates automatically !
Once there are no more docs in the view, you're done.
All you need to do is copy the code to a new agent, set it up for running daily at 4 a.m., and make sure you have the right to run agents.
Good luck !