backup your domino windows server using program documents


IBM Notes and Domino: Tips & Tricks

Backup your Domino Windows Server using Program documents
June 11, 2009

By Lance Zakin, PCLP
Enterprise Architect
Software Engineer
IBM BP NotesMail
Some backup solutions such as Symantec Backup Exec 12.5 currently fail and do not support Domino 8.5 (not compatible with ODS 51 database format). Domino 8.5 users have been waiting 5 months for a hotfix or new release from Symantec. In the meantime, you can use a temporary backup solution using simple Domino Directory Program documents as seen in the example below. It has been successfully tested on Domino 7.x, 8.0.x and 8.5.

The backup solution runs weekly and allows restores 1 week prior to the last run assuming your backup destination location is an internal hard drive. The backup restores can be extended indefinitely if the destination location is an external media device such as a DAT or external hard drive which can be manually rotated on a weekly basis after each backup.



Backup configuration instructions

The instructions below are an example. The scheduled time slots and other parameters can be modified based on your Domino environment.

1. Create a Domino Directory Program document as seen below to compact the databases (discards built view indexes with copy-style compacting) on a day such as Sunday when the Domino server is used the least. This step is necessary to reduce the size of the databases prior to the backup.



2. Create a text file called "NotesMail_Console_Commands.txt" as seen below which contains 8 batch server console commands, and save it to your Domino data folder.

BROADCAST "(!)IBM BP NotesMail - IBM Notes Server backup starting."
BROADCAST "IBM BP NotesMail - IBM Notes Server backup starting."
SH SERVER
SH TASKS
SH STAT
SH USERS
DROP ALL
DBCACHE FLUSH

3. Create a Domino Directory Program document as seen in the example below to execute 8 batch server console commands. This step broadcasts a backup alert message to connected users, clear the database cache and disconnect all users, so the backup can run smoothly. NOTE: The Domino data folder will need to be modified in the Command line field based upon your Domino data installation path.


        Batch Server Console commands:
        BROADCAST "(!)IBM BP NotesMail - IBM Notes Server backup starting."
        BROADCAST "IBM BP NotesMail - IBM Notes Server backup starting."
        SH SERVER
        SH TASKS
        SH STAT
        SH USERS
        DROP ALL
        DBCACHE FLUSH
4. Create a CMD batch file called "NotesMail_Data_Backup.cmd" as seen in the example below, and save it to your Domino data folder. This step performs the backup including creating a log file. NOTE: The drive letters, Domino program folder, Domino data folder and backup folder will need to be modified in the batch file based upon your Domino installation paths. For example, the batch file below assumes Domino data folder "C:\Lotus\Domino\Data" and backup folder "F:\Backup\Lotus\Domino\Data".

@ECHO OFF
REM
REM "Coded by Lance Zakin - www.notesmail.com";
REM
ECHO ...
ECHO IBM BP NotesMail - IBM Domino Data Backup starting...
ECHO ...
ECHO %date% %time%: IBM BP NotesMail - IBM Domino weekly backup started. >> "C:\Lotus\Domino\Data\NotesMail_Data_Backup_Log.txt"
IF NOT EXIST C:\NUL GOTO ERRHANDLE
IF NOT EXIST F:\NUL GOTO ERRHANDLE
F:
IF NOT EXIST F:\Backup\Lotus\Domino MD F:\Backup\Lotus\Domino
IF NOT EXIST F:\Backup\Lotus\Domino\Data MD F:\Backup\Lotus\Domino\Data
XCOPY /Y C:\Lotus\Domino\*.ini F:\Backup\Lotus\Domino
XCOPY /Y C:\Lotus\Domino\Data\*.cmd F:\Backup\Lotus\Domino\Data
XCOPY /Y C:\Lotus\Domino\Data\*.bat F:\Backup\Lotus\Domino\Data
XCOPY /Y C:\Lotus\Domino\Data\*.txt F:\Backup\Lotus\Domino\Data
XCOPY /Y C:\Lotus\Domino\Data\*.ini F:\Backup\Lotus\Domino\Data
XCOPY /Y C:\Lotus\Domino\Data\*.kyr F:\Backup\Lotus\Domino\Data
XCOPY /Y C:\Lotus\Domino\Data\*.sth F:\Backup\Lotus\Domino\Data
XCOPY /Y C:\Lotus\Domino\Data\*.id F:\Backup\Lotus\Domino\Data
XCOPY /Y /S C:\Lotus\Domino\Data\*.ntf F:\Backup\Lotus\Domino\Data
XCOPY /Y /S C:\Lotus\Domino\Data\*.nsf F:\Backup\Lotus\Domino\Data
ECHO %date% %time%: IBM BP NotesMail - IBM Domino weekly backup completed. >> "C:\Lotus\Domino\Data\NotesMail_Data_Backup_Log.txt"
ECHO ...
ECHO IBM BP NotesMail - IBM Domino Data Backup completed.
ECHO ...
@EXIT
:ERRHANDLE
ECHO ...
ECHO ERROR: Backup drive letter not found!
ECHO ...
EcHO %date% %time%: ERROR: Backup drive letter not found! >> "C:\Lotus\Domino\Data\NotesMail_Data_Backup_Log.txt"
@EXIT

5. Create a Domino Directory Program document as seen below. This step will backup all Domino data files (*.nsf, *.ntf, *.ini, *.kyr, *.sth, *.id) by performing a OS level copy to the backup folder. NOTE: The Domino data folder will need to be modified in the Command line field based upon your Domino data installation path.


        Batch file commands:
        @ECHO OFF
        REM
        REM "Coded by Lance Zakin - www.notesmail.com";
        REM
        ECHO ...
        ECHO IBM BP NotesMail - IBM Domino Data Backup starting...
        ECHO ...
        ECHO %date% %time%: IBM BP NotesMail - IBM Domino weekly backup started. >> "C:\Lotus\Domino\Data\NotesMail_Data_Backup_Log.txt"
        IF NOT EXIST C:\NUL GOTO ERRHANDLE
        IF NOT EXIST F:\NUL GOTO ERRHANDLE
        F:
        IF NOT EXIST F:\Backup\Lotus\Domino MD F:\Backup\Lotus\Domino
        IF NOT EXIST F:\Backup\Lotus\Domino\Data MD F:\Backup\Lotus\Domino\Data
        XCOPY /Y C:\Lotus\Domino\*.ini F:\Backup\Lotus\Domino
        XCOPY /Y C:\Lotus\Domino\Data\*.cmd F:\Backup\Lotus\Domino\Data
        XCOPY /Y C:\Lotus\Domino\Data\*.bat F:\Backup\Lotus\Domino\Data
        XCOPY /Y C:\Lotus\Domino\Data\*.txt F:\Backup\Lotus\Domino\Data
        XCOPY /Y C:\Lotus\Domino\Data\*.ini F:\Backup\Lotus\Domino\Data
        XCOPY /Y C:\Lotus\Domino\Data\*.kyr F:\Backup\Lotus\Domino\Data
        XCOPY /Y C:\Lotus\Domino\Data\*.sth F:\Backup\Lotus\Domino\Data
        XCOPY /Y C:\Lotus\Domino\Data\*.id F:\Backup\Lotus\Domino\Data
        XCOPY /Y /S C:\Lotus\Domino\Data\*.ntf F:\Backup\Lotus\Domino\Data
        XCOPY /Y /S C:\Lotus\Domino\Data\*.nsf F:\Backup\Lotus\Domino\Data
        ECHO %date% %time%: IBM BP NotesMail - IBM Domino weekly backup completed. >> "C:\Lotus\Domino\Data\NotesMail_Data_Backup_Log.txt"
        ECHO ...
        ECHO IBM BP NotesMail - IBM Domino Data Backup completed.
        ECHO ...
        @EXIT
        :ERRHANDLE
        ECHO ...
        ECHO ERROR: Backup drive letter not found!
        ECHO ...
        EcHO %date% %time%: ERROR: Backup drive letter not found! >> "C:\Lotus\Domino\Data\NotesMail_Data_Backup_Log.txt"
        @EXIT
.