33 Backup and Recovery

This document contains the following sections:

33.1 Prerequisites for Backup and Recovery

  • Before backing up any part of WebCenter Sites, it is best to shut down the application server. If you are backing up an active WebCenter Sites, ensure the active site is not in use and no requests are being made to the application server.

  • Before recovering any part of WebCenter Sites, ensure the application server is shut down.

33.2 Procedures for Backup and Recovery

33.2.1 WebCenter Sites Installation Directory

This section contains the following subsections:

33.2.1.1 Backup

Jar or tar the WebCenter Sites installation directory.

For example:

tar –cvf ContentServer_backup.tar /u01/CS/Install
jar cvf ContentServer_backup.jar /u01/CS/Install

33.2.1.2 Recovery

Unjar or untar the backed up WebCenter Sites installation directory.

For example:

tar –xvf ContentServer_backup.tar
jar xvf ContentServer_backup.jar

33.2.2 Shared Directory

This section contains the following subsections:

33.2.2.1 Backup

Note:

Backing up the Shared directory is unnecessary if it is located in the WebCenter Sites installation directory, and the installation directory was backed up.

To back up the Shared directory, jar or tar the directory.

For example:

tar –cvf Shared_backup.tar /u01/CS/Shared
jar cvf Shared_backup.jar /u01/CS/Shared

33.2.2.2 Recovery

Note:

Recovering the Shared directory is unnecessary if it is located in the WebCenter Sites installation directory, and the installation directory was recovered.

To recover the Shared directory, unjar or untar the backed up Shared directory and use it to replace the existing one.

For example:

tar –xvf Shared_backup.tar
jar xvf Shared_backup.jar

33.2.3 Web Application .war and .ear Files

Table 33-1 summarizes which types of files in a WebCenter Sites web application must be backed up and recovered.

Table 33-1 Backup and Recovery Information for .war and .ear files

.war/.ear Deployment Method Backup Recovery

Non-Exploded.

For WebCenter Sites on WebSphere

Unnecessary if the WebCenter Sites installation directory is backed up.

(The .war and .ear files are contained in the WebCenter Sites installation directory: <sites_install_dir>/ominstallinfo/app/)

Refer to the steps in Section 33.2.3.2.1, "Recovering Non-Exploded Files."

Exploded.

For WebCenter Sites on:

  • Tomcat

  • WebLogic

No "development changes" to the files.Footref 1

Backup is unnecessary if:

  • The files have not been changed during development,

- and -

  • the WebCenter Sites installation directory is backed up.

(The .war and .ear files are contained in the WebCenter Sites installation directory: <sites_install_dir>/ominstallinfo/app/)

Refer to the steps in Section 33.2.3.2.2, "Recovering Exploded Files with No Development Changes."

With "development changes" to the files.Foot 1 

Backup is required. Refer to the steps in Section 33.2.3.1.3, "Backing Up Exploded Files With Development Changes."

Refer to the steps in Section 33.2.3.2.3, "Recovering Exploded Files with Development Changes."


Footnote 1 The term "development changes" denoted changes to the content, the data model, template code, publishing destinations, and so on.

33.2.3.1 Backup

This section contains the following subsections:

33.2.3.1.1 Backing Up Non-Exploded Files

See Table 33-1.

33.2.3.1.2 Backing Up Exploded Files With No Development Changes

See Table 33-1.

33.2.3.1.3 Backing Up Exploded Files With Development Changes

Jar or tar the deployed WebCenter Sites web application. Label the backup to distinguish it from the compressed cs.war file.

For example:

tar -cvf cs_web_backup.tar /u01/software/Tomcat/webapps/cs
jar cvf cs_web_backup.jar /u01/software/Tomcat/webapps/cs

33.2.3.2 Recovery

This section contains the following subsections:

33.2.3.2.1 Recovering Non-Exploded Files
  1. Undeploy the WebCenter Sites application.

  2. Recover the WebCenter Sites installation directory (for instructions, see Section 33.2.1.2, "Recovery").

  3. Redeploy the WebCenter Sites application.

33.2.3.2.2 Recovering Exploded Files with No Development Changes
  1. Stop the application server.

  2. Delete the exploded web application.

    For example:

    rm -rf /u01/software/Tomcat/webapps/cs/*
    
  3. Recover the WebCenter Sites installation directory (for instructions, see Section 33.2.1.2, "Recovery").

  4. Unjar the backed up WebCenter Sites web application:

    For example:

    cd /u01/software/Tomcat/webapps/cs
    jar xvf <sites_install_dir>/ominstallinfo/app/cs.war
    
33.2.3.2.3 Recovering Exploded Files with Development Changes
  1. Stop the application server.

  2. Delete the exploded web application.

    rm -rf /u01/software/Tomcat/webapps/cs
    
  3. Unjar or untar the backed up WebCenter Sites web application:

    cd /u01/software/Tomcat/webapps
    tar -xvf <path to backup directory>/cs_web_backup.tar
    

33.2.4 WebCenter Sites Database

This section contains the following subsections:

33.2.4.1 Backup

33.2.4.1.1 Backing up SQL Server 2008 and 2008R2
  1. Open SQL Server Management Studio.

  2. Connect to the database server.

  3. Expand Databases.

  4. Right-click on the database to be backed up. Click Tasks, then click Backup.

  5. Under Backup type, select Full. Under Destination, click Add.

  6. Enter the path and file name for the backup file. Click OK.

  7. Under Destination, select the newly created backup location.

  8. Click OK.

33.2.4.1.2 Backing Up Oracle 11g
  1. Log in to the server as the oracle user.

  2. Set ORACLE_HOME to the oracle database directory and ORACLE_SID to the database name.

  3. Log in to sqlplus as sys. Then, do the following:

    1. Use the create directory sql to map to the OS directory, where the exports will be stored. For example:

      SQL> create directory exp_dp_dir as '/u01/backup/exports';

    2. Grant permissions for database export and directory access. For example:

      SQL> grant read, write on directory exp_dp_dir to system;
      SQL> grant EXP_FULL_DATABASE to system

  4. Run the expdp comm and to start exporting. For example:

    expdp system/<password> DIRECTORY=exp_dp_dir DUMPFILE=<file_name>.dmp FULL=y;
    
33.2.4.1.3 Backing Up DB2 9.7
  1. Log in to the server as the db2inst user.

  2. Run the following command:

    db2 force applications all
    
  3. Run the following command:

    db2 backup db <db_name> to <backup_dir> 
    

    Note:

    After the command has completed, note the timestamp. This timestamp will be included in the name of the database backup file.

33.2.4.2 Recovery

33.2.4.2.1 Recovering SQL Server 2008 and 2008R2
  1. Open SQL Server Management Studio.

  2. Expand Databases.

  3. Right-click on the database to be restored. Select Tasks, then select Restore, and then select Database.

  4. Under Source for restore, select From database.

  5. Under Select the backup sets to restore, select the most recent backup.

  6. Click Script at the top.

    This step opens the query editor containing the restore statement.

  7. Edit the query by adding REPLACE, after WITH.

    This will allow the database log to be overwritten.

  8. Click Execute.

33.2.4.2.2 Recovering Oracle 11g
  1. Log in to the server as the oracle user.

  2. Set ORACLE_HOME to the oracle database directory and ORACLE_SID to the database name.

  3. Go to $ORACLE_HOME/bin.

  4. Run the following command:

    ./impdp system/<password> DIRECTORY=exp_dp_dir DUMPFILE=<file_name>.dmp
        SCHEMAS=<YOUR_SCHEMA>;
    
33.2.4.2.3 Recovering DB2 V9.7
  1. Log in to the server as the db2inst user.

  2. Run the following command:

    db2 force applications all
    
  3. Run the following command:

    db2 restore db <db_name> from <backup_dir> replace existing
    

33.2.5 LDAP

This section contains the following subsections:

33.2.5.1 Backup

Use an LDAP browser and export the LDAP configuration.

33.2.5.2 Recovery

Start with a clean LDAP server. Then use an LDAP browser and import the backed up LDAP configuration.

33.3 Running the Recovered WebCenter Sites Application

  1. Before starting the application server:

    1. Clear the search indexes:

      rm –rf <shared_dir>/lucene/Global/*
      
    2. If you are using Tomcat, clear the application server cache:

      rm -rf <server_dir>/tmp/*
      rm -rf <server_dir>/work/*
      

      Note:

      For the WebLogic application server, the cache will be cleared upon redeployment of the application.
    3. If you are using Tomcat or WebLogic, clear the compiled JSPs:

      rm -rf <web_app_dir>/jsp/cs_deployed/*
      
  2. After starting the application server, ensure that all caches are synchronized.