Admins – Need to Restore One Metadata Object from a Backup?

When I think of corruption, it usually is more about government.  Certainly, I don’t picture myself slipping a C-Note to the metadata server for favors, such as giving me special access or maybe ensuing my jobs have priority (wink). Stig Eide, a SAS BI administrator, reminds me that corruption does occur in the metadata – but not exactly  what I was picturing.  When metadata corruption occurs, he has found a way to make it easier on himself – mostly by controlling the metadata backup [no kroners required].  Better if I let him explain … 

Get Control of Your Backup

You (or the platform administrator) has probably set up your site’s metadata server backup. In SAS Management Console 9.3, the metadata server does it by default – so that is great!

One problem you will find when you want to restore a backup, is that (by design, of course) it will restore everything to a specific point in time. But, what if the developers have made many changes that they would not like to lose? They only want to restore that one job that got corrupted? This is the most common scenario for restore requests, in my experience. 

Export Changed Objects to Keep It Simple

In order to restore a single metadata object, you can set up a scheduled export of all the changed objects. That way, you can select the objects you want to restore.

SAS has made a tool for this, called the Batch Export and Import Tools. It creates SPK files, the same that you use when promoting content between environments. But, it works from the command line and it is available on all platforms since 9.2.  

For Windows installations, the utility is called ExportPackage.exe. In UNIX installations, the utility is called Using the command line interface, you can better control what is exported from the metadata.

 The command that I use to export all objects that have changed in the last month is as follows:

"D:\Program Files\SAS\SASPlatformObjectFramework\9.3\ExportPackage.exe" -host metadataserver -port 8561 -user sasadm@saspw -password pwd -objects / -types Job -modified -since "Current day of last month" -package "Jobs.spk" -log "Jobs.log"

You can find the documentation for this command here, but I will describe the parameters that I use:




Metadata server host name 


Metadata server port


User that has permissions to read the metadata objects. If you export stored processes and want to include the physical files, you should use a “real” user, not sasadm.


Password of the user


Top level folder that is exported.  Use a “/” to indicate everything.


Objects that you want to export. You can omit it, or specify a comma separated list, like this:



Specifies that you want the modified date to be used when evaluating the since criterion


Period you want to export changed objects from.  For example, I use “current day of last month”, which will export the same object many times, creating duplicates. But, it will be easier to find it later.


Name of the SPK file that gets created.


Log file name

If you use this command to schedule the backup, you can be sure that you can restore a single object the next time something gets corrupted.

Restoring a Single Object from the Backup

After you have created your backup package, you are ready to restore an object when a user runs into trouble. Here’s how: 

  1. Log in to SAS Management Console as a user with write permissions to the metadata object.
  2. Right-click on the top-level folder you specified in the Objects parameter in your package and select Import SAS package.


  1. Browse to the SPK file that was created by the backup process.


  1. In the Import SAS Package window, select Clear All and Collapse All. Then select the object you want to import.


  1. Complete the import and your issue is resolved.

Author Information

Stig Eide


Stig Eide works for KLP insurance as a platform administrator. He has many years of experience with SAS EBI and DI from an administrators perspective. He holds the highest possible “Certified Platform Administrator for SAS 9”, Level 4. In addition, he considers himself an expert in BASE coding 😉


Learn all about SAS BI

You can learn more about SAS Business Intelligence from the "SAS BI Bible." Take a peek inside the Building Business Intelligience with SAS book.