Backup and Restore IBM Lotus Connections DBs Online

- administration backup ibm ibm-connections

There are many ways to backup your DB2 environment (Offline/Online; Incremental/Delta;Transaction Log backups). I just needed a suitable way to daily backup my Lotus Connections DBs.

I decided to do an Online Backup (no downtime of DBs/Connections) to a local folder and the folder will be backuped by Symantec Backup Exec.

Following steps have to be done to

Backup data:

  1. Update DBs configuration to be ready for Online backups and to store only the latest backup in backup folder. Open a DB2 command window and issue following commands:
<span style="color: #909191;"><span style="background-color: transparent;"><span style="font-family: Courier; font-size: medium;"><span style="font-size: 11px;">db2 update database configuration for BLOGS using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> db2 update database configuration for DOGEAR using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> db2 update database configuration for FILES using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> db2 update database configuration for FORUM using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> db2 update database configuration for HOMEPAGE using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> db2 update database configuration for OPNACT using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> db2 update database configuration for PEOPLEDB using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> db2 update database configuration for SNCOMM using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0<br /> </span></span></span></span><span style="font-family: Courier;"><span style="font-family: Courier;"><span style="color: #909191;"><span style="background-color: transparent;"><span style="font-size: medium;"><span style="font-size: 11px;">db2 update database configuration for WIKIS using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0</span></span></span></span></span></span>
  1. To activate these new settings you have to stop and start your db instance:
<span style="font-family: Courier;"><span style="font-family: Courier;"><span style="color: #909191;"><span style="background-color: transparent;"><span style="font-size: medium;"><span style="font-size: 11px;">db2stop<br /> db2start</span></span></span></span><br /> <span style="font-family: Helvetica; color: #000000;"><span style="background-color: transparent;">or use force flag if DB is locked</span></span><br /> <span style="color: #909191;"><span style="background-color: transparent;"><span style="font-size: medium;"><span style="font-size: 11px;">db2stop force<br /> db2start</span></span></span></span></span></span>
  1. Now backup your DBs to a folder (i.e. Backup_Online): db2 backup database BLOGS to D:\Backup_Online db2 backup database DOGEAR to D:\Backup_Online db2 backup database FILES to D:\Backup_Online db2 backup database FORUM to D:\Backup_Online db2 backup database HOMEPAGE to D:\Backup_Online db2 backup database OPNACT to D:\Backup_Online db2 backup database PEOPLEDB to D:\Backup_Online db2 backup database SNCOMM to D:\Backup_Online db2 backup database WIKIS to D:\Backup_Online
  2. From now on do regular compressed backups of the DBs and include log files (do not forget to backup the folder with you backup agent): db2 backup database BLOGS ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database DOGEAR ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database FILES ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database FORUM ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database HOMEPAGE ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database OPNACT ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database PEOPLEDB ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database SNCOMM ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS db2 backup database WIKIS ONLINE to D:\Backup_Online COMPRESS INCLUDE LOGS

 

To Restore all your Data you first have to recreate all 9 DBs with the Lotus Connections DB Wizard:

  1. Run the DB wizard and recreate all 9 DBs
  2. Run following commands inside a DB2 command window to restore the data: db2 restore database BLOGS from D:\Backup_Online REPLACE EXISTING db2 restore database DOGEAR from D:\Backup_Online REPLACE EXISTING db2 restore database FILES from D:\Backup_Online REPLACE EXISTING db2 restore database FORUM from D:\Backup_Online REPLACE EXISTING db2 restore database HOMEPAGE from D:\Backup_Online REPLACE EXISTING db2 restore database OPNACT from D:\Backup_Online REPLACE EXISTING db2 restore database PEOPLEDB from D:\Backup_Online REPLACE EXISTING db2 restore database SNCOMM from D:\Backup_Online REPLACE EXISTING db2 restore database WIKIS from D:\Backup_Online REPLACE EXISTING
  3. Now you have to extract the archive logs from BLOGS db image. Create a temp folder D:\temp and extract archive logs into that folder:
<span style="font-family: Courier; color: #000000;"><span style="background-color: transparent;"><span style="color: #909191;"><span style="background-color: transparent;"><span style="font-size: medium;"><span style="font-size: 11px;">db2 restore database BLOGS LOGS from D:\Backup_Online LOGTARGET D:\temp</span></span></span></span><span style="font-size: medium;"><br /> </span><br /> </span></span>
  1. Now you can apply the transactions which are stored in these log files:
<span style="font-family: Courier; color: #000000;"><span style="background-color: transparent;"><span style="color: #909191;"><span style="background-color: transparent;"><span style="font-size: medium;"><span style="font-size: 11px;">db2 rollforward database BLOGS to end of logs overflow log path (D:\temp)<br /> </span></span></span></span><br /> </span></span>
  1. Complete the rollforward process, otherwise you will not have access to the DB: db2 rollforward database BLOGS complete
  2. Delete all files in D:\temp
  3. Repeat extracting the archive logs, apply logs and completion of rollforward process for DOGEAR: db2 restore database DOGEAR LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database DOGEAR to end of logs overflow log path (D:\temp) db2 rollforward database DOGEAR complete
  4. Delete all files in D:\temp
  5. Repeat extracting the archive logs, apply logs and completion of rollforward process for FILES: db2 restore database FILES LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database FILES to end of logs overflow log path (D:\temp) db2 rollforward database FILES complete
  6. Delete all files in D:\temp
  7. Repeat extracting the archive logs, apply logs and completion of rollforward process for FORUM: db2 restore database FORUM LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database FORUM to end of logs overflow log path (D:\temp) db2 rollforward database FORUM complete
  8. Delete all files in D:\temp
  9. Repeat extracting the archive logs, apply logs and completion of rollforward process for HOMEPAGE: db2 restore database HOMEPAGE LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database HOMEPAGE to end of logs overflow log path (D:\temp) db2 rollforward database HOMEPAGE complete
  10. Delete all files in D:\temp
  11. Repeat extracting the archive logs, apply logs and completion of rollforward process for OPNACT: db2 restore database OPNACT LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database OPNACT to end of logs overflow log path (D:\temp) db2 rollforward database OPNACT complete
  12. Delete all files in D:\temp
  13. Repeat extracting the archive logs, apply logs and completion of rollforward process for PEOPLEDB: db2 restore database PEOPLEDB LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database PEOPLEDB to end of logs overflow log path (D:\temp) db2 rollforward database PEOPLEDB complete
  14. Delete all files in D:\temp
  15. Repeat extracting the archive logs, apply logs and completion of rollforward process for SNCOMM: db2 restore database SNCOMM LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database SNCOMM to end of logs overflow log path (D:\temp) db2 rollforward database SNCOMM complete
  16. Delete all files in D:\temp
  17. Repeat extracting the archive logs, apply logs and completion of rollforward process for WIKIS: db2 restore database WIKIS LOGS from D:\Backup_Online LOGTARGET D:\temp db2 rollforward database WIKIS to end of logs overflow log path (D:\temp) db2 rollforward database WIKIS complete

That’s it, now you can work with your restored data again. Happy Social Business.