3.11 Procedure to Restore Deleted Documents on IBM i 
|
If someone accidentally deleted documents in a Domino application or database, you need to recover the documents. This article assists you in this task by providing procedures, hints and tips to restore deleted documents in IBM i environment. |
ShowTable of Contents
Table of Contents
This article assists you when trying to recover documents that were accidentally deleted within a Domino application or database.
It is assumed that you will be restoring a copy of the database prior to the document deletions. The restored database will be placed on the server and the user will then access the restored copy of the application to copy and paste the documents back into the existing database.
There are a number of considerations that should be made when performing this type of restore:
- DBIID: You must ensure that you will not have 2 databases on the server with the same DBIID because multiple databases with the same DBIID could damage your transaction logs.
- Replication: You need to prevent any replication attempts to the restored database. To accomplish this you must prevent access to the database or ensure the database replica ID is changed during the restore process.
- Scheduled agents: If the application being restored has agents that normally would run on this server, you want to ensure these agents are disabled as part of the restore process to prevent the agent from running on this temporary file.
Since there are different restore requirements and/or limitations depending on the type of save you performed, figure 1 below and the subsequent explanations walk you through the restore process with these factors already considered for you. The complete steps and commands can be found in the appropriate sections below the diagram.
Operating Type Save Restore Procedure
- Gather the tape(s) from last save of the database/ application.
- Restore database to a folder outside of the data directory:
If you do not have a restore directory already created, create one now. For example:
CRTDIR '/Restore'
Restore the database to the new folder. For example:
RST DEV('/qsys.lib/tap01.devd') OBJ(('/notes/data/mail/mailfile.nsf' *INCLUDE '/restore/mailfile.nsf'))
Set permissions so the QNOTES user profile can access the directory and object. For example:
CHGOWN OBJ('/Restore') NEWOWN(QNOTES) SUBTREE(*ALL)
- (Optional) Use an agent to disable scheduled agents from running on the database. A server side scheduled agent would open the database from this path outside the Domino Data directory and set the DB property “Disable background agents in this file”. The source code for such an agent can be found in IBM Technote 1380020 or as an alternative simply disable all scheduled agents as described in the end of IBM Technote 1201461
- Create a restore folder in the server data directory. In the Domino Administrator go to the Files tab. In the right hand panel select Folder → New.... Give the folder the desired name such as Restore.
- Use the CL Copy command to copy the database to the Restore folder within the data directory. Using the CL copy command will ensure that the database will have a new DBIID and replica id when placed on the server. The Domino console commands to issue are as follows:
set config CLUSTER_ADMIN_ON=1 this will enable the use of the CL Copy command.
CL COPY /restore/mailfile.nsf restore/mailfile.nsf Note that the initial entry is the source database with the complete path and the second entry is the destination with a path relative to the data directory.
- Verify integrity of restored database and DAOS links by running fixup. For example:
load fixup -j restore/mailfile.nsf
Note: The fixup can be skipped if running 8.5.1 FP2, 8.5.2 or higher and restoring to the same server (refer to SPR DROO7YXTC3). The fixup process is critical when restoring to a different server as the fixup process is needed to update the .nlo file hints stored within the documents of the database.
- Copy and paste the needed documents into the existing database. If you get an error regarding a missing .nlo file you can get the file name from the error message posted in ddm.nsf or generate a list of the .nlo files needed to be restored using the "listnlo" command. For example:
tell daosmgr listnlo -o missing_nlo_files.txt MISSING restore/mailfile.nsf
- Review output from the "listnlo" command above and restore any files listed. Note that the same file may be listed multiple times in the output, one for each reference to the missing attachment. The syntax for the restore is the same as step #2. For example:
RST DEV('/qsys.lib/tap01.devd') OBJ(('/notes/DAOS/0001/AAC48E7FC07B6CC71ADD186896DC4F48509F165801A8702F.nlo'))
- Cleanup by remove the restored database. Remove the copy within the data directory using the Delete Database right click menu option in the Domino Administrator Files tab. To delete the file outside of the data directory use the following command:
RMVLNK OBJLNK('/restore/mailfile.nsf')
The restore directories may be retained for reuse or removed at your discretion.
BRMS Full Save Restore Procedure
- Gather the tape(s) from last save of the Domino server.
- Create a restore folder in the server data directory. In the Domino Administrator go to the Files tab. In the right hand panel select Folder → New.... Give the folder the desired name such as Restore.
- Set a directory ACL to prevent all users and servers from accessing the directory. This will prevent replication and thus prevent propagating deletions to this newly restored database. To enable this feature you must set enable_acl_files=1 in your NOTES.INI. To do this, enter the Domino console command set config enable_acl_files=1. You can then return to the Domino Administrator Files tab, right click on the folder and choose Manage Directory ACL. From there choose an administrator to be able to access the directory, but no other users or servers as shown in figure 2.

- Use RSTBRM, WRKLNKBRM, WRKMEDIBRM, or System i Navigator to restore the database to your restore folder. Here is an example of RSTBRM:
RSTBRM DEV(*MEDCLS) OBJ(('/server1/data/mail/mailfile.nsf' *INCLUDE '/server1/data/restore/mailfile.nsf'))
- Change the Replica ID of the restored database using CL Copy, an agent or 3rd party utility such as Antrid. For information on changing the replica id refer to technote 1094568. Here is an example of using CL Copy:
set config CLUSTER_ADMIN_ON=1 this will enable the use of the CL Copy command.
CL COPY restore/mailfile.nsf restore/mailfile2.nsf Note that the initial entry is the source database with the complete path and the second entry is the destination with a path relative to the data directory.
Remove the copy that the database with the original replica id using the Delete Database right click menu option in the Domino Administrator Files tab.
- (Optional) Disable any scheduled agents in the restored database manually or via an agent. A server side scheduled agent would open the database from and set the DB property “Disable background agents in this file”. The source code for such an agent can be found in IBM Technote 1380020 or as an alternative simply disable all scheduled agents as described in the end of IBM Technote 1201461.
- Remove the directory ACL. To do this return to the Domino Administrator Files tab, right click on the folder and choose Manage Directory ACL. From there remove all entries from the Who should be able to access this directory list.
- Verify integrity of restored database and DAOS links by running fixup. For example:
load fixup -j restore/mailfile2.nsf
Note: The fixup can be skipped if running 8.5.1 FP2, 8.5.2 or higher and restoring to the same server (refer to SPR DROO7YXTC3). The fixup process is critical when restoring to a different server as the fixup process is needed to update the .nlo file hints stored within the documents of the database.
- Copy and paste the needed documents into the existing database. If you get an error regarding a missing .nlo file you can get the file name from the error message posted in ddm.nsf or generate a list of the .nlo files needed to be restored using the "listnlo" command. For example:
tell daosmgr listnlo -o missing_nlo_files.txt MISSING restore/mailfile2.nsf
- Review output from the "listnlo" command above and restore any files listed. Note that the same file may be listed multiple times in the output, one for each reference to the missing attachment. The syntax for the restore is the same as step #2. For example:
RST DEV('/qsys.lib/tap01.devd') OBJ(('/notes/DAOS/0001/AAC48E7FC07B6CC71ADD186896DC4F48509F165801A8702F.nlo'))
- Cleanup by removing the restored database. Remove the copy within the data directory using the Delete Database right click menu option in the Domino Administrator Files tab.
BRMS Incremental Save Restore Procedure
- Gather tape from the server saves starting with last full save prior to the desired restore date along with each incremental from the full save to the desired restore date of the Domino server.
- If you need to recover to a point in time between now and last save, run an incremental (transaction logs only) save now.
- Create a restore folder in the server data directory. In the Domino Administrator go to the Files tab. In the right hand panel select Folder → New.... Give the folder the desired name such as Restore.
- Create the required data area to force the replica ID to be modified during the restore with the following command:
CRTDTAARA DTAARA(QUSRNOTES/QNNIDIFFID) TYPE(*CHAR) LEN(1)
The data area needs to be owned by QNOTES. Set the owner with the following command:
CHGOBJOWN QUSRNOTES/QNNIDIFFID *DTAARA NEWOWN(QNOTES)
- Use RSTBRM, WRKLNKBRM, WRKMEDIBRM, or System i Navigator to restore the database to your restore folder. Here is an example of RSTBRM:
STBRM DEV(*MEDCLS) OBJ(('/server1/data/mail/mailfile.nsf' *INCLUDE '/server1/data/restore/mailfile.nsf'))
- (Optional) Disable any scheduled agents in the restored database manually or via an agent. A server side scheduled agent would open the database from this path and set the DB property “Disable background agents in this file”. The source code for such an agent can be found in IBM Technote 1380020 or as an alternative simply disable all scheduled agents as described in the end of IBM Technote 1201461.
- Verify integrity of restored database and DAOS links by running fixup. For example:
load fixup -j restore/mailfile.nsf
Note: The fixup can be skipped if running 8.5.1 FP2, 8.5.2 or higher and restoring to the same server (refer to SPR DROO7YXTC3). The fixup process is critical when restoring to a different server as the fixup process is needed to update the .nlo file hints stored within the documents of the database.
- Copy and paste the needed documents into the existing database. If you get an error regarding a missing .nlo file you can get the file name from the error message posted in ddm.nsf or generate a list of the .nlo files needed to be restored using the "listnlo" command. For example:
tell daosmgr listnlo -o missing_nlo_files.txt MISSING restore/mailfile.nsf
- Review output from the "listnlo" command above and restore any files listed. Note that the same file may be listed multiple times in the output, one for each reference to the missing attachment. The syntax for the restore is the same as step #2. For example:
RST DEV('/qsys.lib/tap01.devd') OBJ(('/notes/DAOS/0001/AAC48E7FC07B6CC71ADD186896DC4F48509F165801A8702F.nlo'))
- Cleanup by remove the restored database. Remove the copy within the data directory using the Delete Database right click menu option in the Domino Administrator Files tab.
Additional Resources
|
|
|
|
| Version 2 |
March 11, 2011 |
11:36:18 AM |
by Amy Hoerle  |
|
|