Best Practices for Backing Up Your SAS Content

Always Use the Metadata Server Backup Facility to Back Up the Repository Manager and the Metadata Repositories

The processes that you use to make regular system backups of your file system cannot directly access the metadata repositories, because the repository data sets are normally locked. Therefore, the recommended method for backing up your metadata repositories, the repository manager, and the metadata server's configuration directory is to use the metadata server backup facility. By default, the backup facility runs scheduled backups at 1:00 a.m. daily. Administrators can change this schedule as needed. Your daily system backup process can then copy the files from the metadata server’s backup destination.
The advantages of the metadata server backup facility are described in About the Metadata Server Backup Facility.
CAUTION:
If you choose to use operating system commands to back up your metadata repositories and the repository manager, instead of using the metadata server’s backup facility, then you must be sure to pause the metadata server before performing the backup. Otherwise, the backup files will not be usable.

Perform Regularly Scheduled Full Backups

By default, the metadata server backup facility takes daily backups of your metadata repositories, the repository manager, and the files in the metadata server's configuration directory. To safeguard the integrity of your metadata, it is important to maintain this backup schedule. Daily use of the metadata server backup facility will enable you to recover the server to a particular point in time in the event of a server failure, while correctly maintaining associations between metadata.
To maintain system integrity, you must also back up the SAS Content Server, the SAS Framework Data Server, and the physical files that are associated with your metadata. See the following topics:

Perform Backups before and after Major Changes

In addition to your regular full backup schedule, you should also perform a full backup before and after making major changes to your system. For example, you should perform a backup on the following occasions:
  • after you complete your initial installation and configuration
  • before and after you update your SAS software to a new release
  • before and after you configure a new SAS product or remove the configuration of an existing product
  • before and after you configure a new tier in your SAS deployment
  • after you add a new repository
  • before you delete a repository
The best way to perform an ad hoc (unscheduled) backup of the metadata server is to use the metadata server backup facility. You can launch this facility from SAS Management Console, from the operating system command line, from a SAS session, or through a third-party scheduling system.
In unscheduled backup situations that involve associated content and files (for example, the addition of new reports or stored processes), be sure to include the SAS Content Server, the SAS Framework Data Server, and the physical files in your backup. If the backup does not involve a large amount of data, then the Import and Export wizards can be useful for this type of backup. See About Using the Export SAS Package Wizard to Back Up Specific SAS Folders.
In unscheduled backup situations where the metadata has changed but no physical files are involved, it is sufficient to back up just the metadata server. For example, no physical files are affected when you make changes to server definitions, user and group definitions, and access control templates. If you choose not to back up the physical files, you should make sure that no user activity that affects physical files has taken place since the last backup was taken. For example, make sure that no stored processes, jobs, or reports have been created or modified since the last backup.

Specify a Reliable Backup Destination That Is Included in Daily System Backups

By default, the metadata server backup facility writes backup files and journal files to the Backups subdirectory of the metadata server configuration directory. Within the backup location, each set of backup files (along with the associated journal file) is stored in a directory that is named based on the date and time that the backup is started.
As a best practice, you should modify your backup configuration to specify a storage device other than the device that is used to store the metadata repositories and the server configuration files. Specifying a separate device will ensure that backup files and their associated journal files (including the most current journal file) are available in the event of a disk failure.
Make sure that the Backups directory (or the backup destination that you specify) is included in your regular system backups.

Occasionally Use the Reorganize Repositories Option to Reclaim Unused Disk Space

When metadata is deleted from a metadata repository, the record is removed from both memory and disk. However, the disk space that had been allocated for the record remains in the data set after the record is removed.
When you use the metadata server backup facility, you can use the Reorganize Repositories option to reclaim unused disk space that is left from previously deleted metadata objects. The default backup schedule specifies a weekly reorganization. It is not necessary to reorganize the repositories more frequently than once a week, except in extraordinary situations such as the deletion of a large amount of metadata.
The repository reorganization process affects disk space only. It does not affect the memory usage of the metadata server.

Back Up the SAS Content Server

If your deployment includes SAS Web applications or the SAS Web Infrastructure Platform, then it is important to back up the SAS Content Server when you back up the metadata server. The SAS Content Server contains content that is associated with metadata objects that are contained in the repositories, including the following:
  • content for the SAS Information Delivery Portal
  • report definition files
  • other supporting files for reports, including PDF files and image files
  • content for SAS solutions
Metadata cannot be used without the associated content that is stored on this server. If you need to recover from a failure, the metadata that you restore must be synchronized correctly with the content server.
To back up the SAS Content Server:
  1. As a best practice, stop either the Web application server or the SAS Content Server application before making the backup. If you are using an IBM WebSphere Application Server or an Oracle WebLogic Server, then it is sufficient to stop only the SAS Content Server application. If you are using a JBoss Application Server, then you must stop both the SAS Content Server application and the JBoss Application Server.
  2. Use operating system commands or third-party tools to copy all of the files and subdirectories from the following path:
    SAS-configuration-directory/Lev1/AppData/SASContentServer/Repository
If you need to back up just a subset of the SAS Content Server, or if you want to create a backup for input to a system other than the SAS Content Server, you can use the WebDAVDump and WebDAVRestore utilities. For instructions, see SAS Usage Note 38667.

Back Up the SAS Framework Data Server and Its Databases

If your deployment includes a SAS Framework Data Server, then it is important to back up the server and its databases. The server might contain the following databases:
  • SYSCAT.TDB, which is a transactional database file that stores configuration information for the server.
  • SHAREDSERVICES.FDB, which is the default storage location for middle-tier data such as alerts, comments, and workflows. (During installation, a different type of database might have been specified for this data.)
  • LINEAGESERVICE.FDB, which is the default storage location for metadata connection information that is used by SAS Environment Manager. (During installation, a different type of database might have been specified for this data.)
To back up all of the SAS Framework Server files including scripts, logs, configuration files, and databases, follow these steps:
  1. Stop the SAS Framework Data Server.
  2. Use operating system commands or third-party tools to copy all of the files and subdirectories from the following path:
    SAS-configuration-directory/Lev1/FrameworkServer
If necessary, you can back up the SYSCAT.TDB and SHAREDSERVICES.FDB databases while the server is running. To do so, use the following command:
dffedfire –gbak –b database-name –mode read_only –user sysdba –pass 
     masterkey backup-filename
If you need to restore a database from a backup, stop the SAS Framework Data Server and then use following command to perform the restore:
dffedfire –gbak –r backup-filename –user sysdba –pass masterkey 
     database-name
The dffedfire command and the databases are typically located in SAS-configuration-directory/Lev1/FrameworkServer/dffedsvrcfg.
SHAREDSERVICES.FDB might have been assigned a different location when SAS 9.3 was installed. For more information about this database, see the SAS Intelligence Platform: Middle-Tier Administration Guide.

Back Up Data That Is Stored in File Systems

When you back up the metadata server, it is important to also back up the physical data that is associated with the metadata objects that are contained in the repositories. The metadata cannot be used without the associated data. If you need to recover from a failure, the metadata that you restore must be synchronized correctly with the associated data.
You must use operating system commands or third-party tools to back up the physical data, which might include the following:
  • portal content that is not stored in the SAS Content Server, including custom portlets, custom themes, and applications
  • report definition files and other supporting files for reports (for example, PDF files and image files) that are stored in your file system, if you are not storing these items on the SAS Content Server
  • source files for stored processes
  • packages that have been published to a channel's persistent store (archive) location
  • stored process results that are stored in permanent packages
  • data sources, including the following:
    • SAS tables
    • OLAP data
    • SAS Scalable Performance Data Server data
    • RDBMS data sets
  • custom code, processes, and postprocesses that are associated with SAS Data Integration Studio jobs
  • XML files and XML maps that are contained in libraries
  • source files for SAS Data Integration Studio jobs that have been scheduled or deployed for scheduling

Synchronize Metadata Backups with SAS Content Server, SAS Framework Data Server, and Physical File Backups

Suggested Approach for Synchronizing Metadata Backups with Physical Backups

To maintain system integrity in the event that a restore is needed, your backups of the SAS Content Server, SAS Framework Data Server, and physical data must be synchronized correctly with your metadata backups. To ensure that the backups are synchronized, you can use one of the following approaches:
  • Back up the metadata server, the SAS Content Server, the SAS Framework Data Server, and the physical files concurrently (that is, in the same backup window).
  • Back up the SAS Content Server, the SAS Framework Data Server, and the physical files immediately after the metadata server is backed up, and do not allow clients to update metadata while you are performing these backups. If you are running the backup on a batch basis (for example, as part of a daily schedule), then you can do the following to implement this approach
    1. Write a program that uses PROC METAOPERATE to pause the metadata server to an Offline state. See Example of a PROC METAOPERATE Program That Pauses the Metadata Server to an Offline State.
      You can use this program to pause the metadata server while you back up the SAS Content Server, the SAS Framework Data Server, and associated physical data. If you use operating system commands to back up the metadata server, then you can use this program to pause the server before running the backup.
    2. Write another program that resumes the metadata server to an Online state. See Example of a PROC METAOPERATE Program That Resumes the Metadata Server. You can use this program after using operating system commands to back up the metadata server, or you can use it after backing up the SAS Content Server, the SAS Framework Data Server, and associated physical data.
  • If you are running an ad hoc (unscheduled) backup and you need to also back up associated data, then you can do the following to prevent clients from updating metadata while you are backing up the associated data:
    1. Use the metadata backup facility to back up the metadata server. Then immediately use SAS Management Console to pause the metadata server. As an alternative, you can use SAS Management Console to temporarily change the registered access mode of the repositories to ReadOnly.
    2. Back up the SAS Content Server, the SAS Framework Data Server, and the physical data.
    3. When you are finished backing up the SAS Content Server, the SAS Framework Data Server, and the physical data, use SAS Management Console to resume the metadata server (or to return the registered access mode of the repositories to Online).

Example of a PROC METAOPERATE Program That Pauses the Metadata Server to an Offline State

Here is an example program that uses PROC METAOPERATE to pause the metadata server to an Offline state.
If you use operating system commands to back up the metadata server, you can use this program to pause the server before running the backup.
If you use the metadata server backup facility, it is not necessary to pause the server while you back it up. However, you can use this program to pause the metadata server while you back up the SAS Content Server, SAS Framework Data Server, and associated physical data.
proc metaoperate
        server="host-name"
        port=8561
        userid="user-ID"
        password="encoded-password"
        protocol=bridge
        action=pause
        noautopause;
run;
The user that is specified in user-ID must be assigned to the Metadata Server: Operation role.

Example of a PROC METAOPERATE Program That Resumes the Metadata Server

Here is an example program that uses PROC METAOPERATE to resume the metadata server to an Online state. You can use this program after using operating system commands to back up the metadata server, or you can use it after backing up the SAS Content Server, SAS Framework Data Server, and associated physical data.
proc metaoperate
        server="host-name"
        port=8561
        userid="user-ID"
        password="encoded-password"
        protocol=bridge
        action=resume
        noautopause;
run;
The user that is specified in user-ID must be assigned to the Metadata Server: Operation role.
For detailed information about PROC METAOPERATE, see SAS Language Interfaces to Metadata..