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:

    db2 update database configuration for BLOGS using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for DOGEAR using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for FILES using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for FORUM using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for HOMEPAGE using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for OPNACT using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for PEOPLEDB using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for SNCOMM using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0
    db2 update database configuration for WIKIS using LOGARCHMETH1 LOGRETAIN AUTO_DEL_REC_OBJ ON num_db_backups 1 rec_his_retentn 0

  2. To activate these new settings you have to stop and start your db instance:

    db2stop
    db2start

    or use force flag if DB is locked
    db2stop force
    db2start

  3. 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

  4. 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:

    db2 restore database BLOGS LOGS from D:\Backup_Online LOGTARGET D:\temp

  4. Now you can apply the transactions which are stored in these log files:

    db2 rollforward database BLOGS to end of logs overflow log path (D:\temp)

  5. Complete the rollforward process, otherwise you will not have access to the DB:
    db2 rollforward database BLOGS complete

  6. Delete all files in D:\temp

  7. 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

  8. Delete all files in D:\temp

  9. 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

  10. Delete all files in D:\temp

  11. 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

  12. Delete all files in D:\temp

  13. 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


  14. Delete all files in D:\temp

  15. 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


  16. Delete all files in D:\temp

  17. 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


  18. Delete all files in D:\temp

  19. 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


  20. Delete all files in D:\temp

  21. 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.