backup the hcl domino windows server using program documents


HCL Notes and Domino: Tips & Tricks

Backup the HCL Domino Windows Server using Program documents 💿💾
June 11, 2009 (Updated Jan 25, 2021)

By Lance Zakin, HCL CASA, CAAD
Notes and Domino
HCL BP NotesMail
Some backup solutions (i.e. Backup Exec 12.5) currently fail and do not yet support newer Domino versions in which the NSF format has been converted to the new ODS. 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 11/10/9/8.

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 "(!)HCL BP NotesMail - HCL Notes Server backup starting."
BROADCAST "HCL BP NotesMail - HCL 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 "(!)HCL BP NotesMail - HCL Notes Server backup starting."
        BROADCAST "HCL BP NotesMail - HCL 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:\Program Files\HCL\Domino\Data" and backup folder "F:\Backup\HCL\Domino\Data".

@ECHO OFF
REM
REM "Coded by Lance Zakin - www.notesmail.com";
REM
ECHO ...
ECHO HCL BP NotesMail - HCL Domino Data Backup starting...
ECHO ...
ECHO %date% %time%: HCL BP NotesMail - HCL Domino weekly backup started. >> "C:\Program Files\HCL\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\HCL\Domino MD F:\Backup\HCL\Domino
IF NOT EXIST F:\Backup\HCL\Domino\Data MD F:\Backup\HCL\Domino\Data
XCOPY /Y "C:\Program Files\HCL\Domino\*.ini"" F:\Backup\HCL\Domino
XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.cmd" F:\Backup\HCL\Domino\Data
XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.bat" F:\Backup\HCL\Domino\Data
XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.txt" F:\Backup\HCL\Domino\Data
XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.ini" F:\Backup\HCL\Domino\Data
XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.kyr" F:\Backup\HCL\Domino\Data
XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.sth" F:\Backup\HCL\Domino\Data
XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.id" F:\Backup\HCL\Domino\Data
XCOPY /Y /S C:\Program Files\HCL\Domino\Data\*.ntf" F:\Backup\HCL\Domino\Data
XCOPY /Y /S C:\Program Files\HCL\Domino\Data\*.nsf" F:\Backup\HCL\Domino\Data
ECHO %date% %time%: HCL BP NotesMail - HCL Domino weekly backup completed. >> "C:\Program Files\HCL\Domino\Data\NotesMail_Data_Backup_Log.txt"
ECHO ...
ECHO HCL BP NotesMail - HCL 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:\Program Files\HCL\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 HCL BP NotesMail - HCL Domino Data Backup starting...
        ECHO ...
        ECHO %date% %time%: HCL BP NotesMail - HCL Domino weekly backup started. >> "C:\Program Files\HCL\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\HCL\Domino MD F:\Backup\HCL\Domino
        IF NOT EXIST F:\Backup\HCL\Domino\Data MD F:\Backup\HCL\Domino\Data
        XCOPY /Y "C:\Program Files\HCL\Domino\*.ini" F:\Backup\HCL\Domino
        XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.cmd" F:\Backup\HCL\Domino\Data
        XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.bat" F:\Backup\HCL\Domino\Data
        XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.txt" F:\Backup\HCL\Domino\Data
        XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.ini" F:\Backup\HCL\Domino\Data
        XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.kyr" F:\Backup\HCL\Domino\Data
        XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.sth" F:\Backup\HCL\Domino\Data
        XCOPY /Y "C:\Program Files\HCL\Domino\Data\*.id" F:\Backup\HCL\Domino\Data
        XCOPY /Y /S C:\Program Files\HCL\Domino\Data\*.ntf" F:\Backup\HCL\Domino\Data
        XCOPY /Y /S C:\Program Files\HCL\Domino\Data\*.nsf" F:\Backup\HCL\Domino\Data
        ECHO %date% %time%: HCL BP NotesMail - HCL Domino weekly backup completed. >> "C:\Program Files\HCL\Domino\Data\NotesMail_Data_Backup_Log.txt"
        ECHO ...
        ECHO HCL BP NotesMail - HCL 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:\Program Files\HCL\Domino\Data\NotesMail_Data_Backup_Log.txt"
        @EXIT
.