This is the last of a series of three articles that talk about promoting content to SAS Visual Analytics (VA) 8.2. If you haven’t seen it yet, I recommend you reading the first and second one, before continuing.
While the first article gives an overview, this one expands the discussion and provides details about taking content from SAS VA 8.1, and 8.2, and promoting it to VA 8.2.
The diagram below has been shared before and it summarizes the entire promotion process, but this time we will be focusing on VA 8.x as a source.
Just to recap, promotion process is made of four steps:
If you have read the previous publication article (Promotion of SAS Visual Analytics 7.x to 8.2) , you will notice that the upload and import steps are very similar to the ones described here.
When promoting content from VA 8.1, you must use the command line transfer CLI for the first two steps: export and download. For the remaining steps, upload and import, you can choose between continuing with the transfer CLI or using the SAS Environment Manager (EV) GUI that is available with VA 8.2. You might have seen this table already from a previous article, but I’ve added it here for a quick reference.
If you are promoting content from VA 8.2, both command line and EV GUI are supported.
If you haven’t read it yet, I recommend you checking the section called Command Line Interface from the previous publication article (Promotion of SAS Visual Analytics 7.x to 8.2). This section gives an introduction to the sas-admin command line (and transfer CLI) that is new in VA 8.2, and is used for most of the steps in the promotion process described here.
For the steps that follow, I assume you already created a profile and an authentication token not only for VA 8.2 as the target, but also for VA 8.1 as the source (or another VA 8.2 environment if promoting from 8.2 to 8.2). The steps to create a profile and an authentication token for the source and target environments are the same explained in the previous publication. You just need to inform the proper service point and credentials:
sas-admin --profile <source81or82> profile init sas-admin --profile <source81or82> auth login sas-admin --profile <target82> profile init sas-admin --profile <target82> auth login
Note: In the screenshots presented here I’m logged in the CAS Controller (microservices) node as root, but you don’t need root access.
Once the profiles and tokens are ok, you can start with the export. Now let’s cover the steps of the promotion process.
To export content from VA 8.x via transfer CLI, you must log into your source VA environment and obtain the content URI from SAS Environment Manager - Content:
The command line looks like this, and it creates a package called <package_name>:
sas-admin --profile <source81or82> transfer export -u <content_uri> -n <package_name>
In the example above we’ve selected the URI for a single report called “Retail Sales in LA”. In case you select the URI of a folder, all reports within that folder will be exported. You can also select multiple content URI’s and place them in a JSON file that describes the content you want in your package. For example:
When listing content in a JSON file, the export command line is slightly different:
sas-admin --profile <source81or82> transfer export -r @<list_json_file>
No package name is provided in the command line because it’s already in the JSON file. For more details on this command syntax, you can check sas-admin transfer export --help
No matter which method you use, a package is created and added to the repository. You will need the package ID for the next step. The ID is provided in the output of the export command, but you can also find it by listing the packages in the repository:
sas-admin --profile <source81or82> transfer list
The download step is accomplished by this command:
sas-admin --profile <source81or82> transfer download –id <package_id> -f <json_file>
The <package_id> came from the previous step and <json_file> is how you want to call the output file.
After that, you should have your JSON file created.
The upload step uses a command that is very similar to the upload command for VA 7.x, but instead of an SPK file, you upload the JSON file created in the previous step.
sas-admin --profile <source81or82> transfer upload -f <json_file> -m <mapping_file>
As the output, you will have a package and a template mapping file created.
The mapping file was discussed in the previous publication article, “Promotion from SAS Visual Analytics 7.x to 8.2.” As explained there, the mapping file that is created for you already contains all source tables used in the just uploaded package, as a template. If tables are located in the same CAS server and library, and their names are the same in both the source and target systems, there is nothing you need to do with this mapping file. If any of those change, you need to edit the mapping file before running the next step. The sample mapping file below contains only one table and it has been edited to account for changes in the library and table name:
Observe that, besides the syntax being slightly different for source and target attributes when compared to VA 7.x, this mapping file doesn’t have a default section, as explained when promoting content from VA 7.x to 8.2.
Similarly to when promoting from VA 7.x, you can have a mapping file with more tables than just the ones used in the currently promoted package, in case you want to keep a central mapping file that can be used with multiple packages.
The package is not a physical file, but an entry in a repository instead. You will need the package ID that is displayed in the output of the upload command for the next step.
The import step will create the report (or reports) in VA 8.2, given a package ID and the mapping file created/edited previously. The command line looks like this:
sas-admin --profile <source81or82> transfer import --id <package_id> -m <mapping_file>
If you don’t have access to the output of the previous upload command, you can obtain the package ID by listing packages and their IDs as explained above in the Export section.
SAS Environment Manager GUI, or simply EV GUI for short, allows for easier promotion of content, especially from another VA 8.2 environment. When using the EV GUI, export and download steps are combined in one single step to generate the content JSON file. This file is then uploaded and imported into the target VA 8.2 environment as a single step as well. Intermediate packages are not created with the GUI, nor are mapping files. Because there are no mapping files, you can only use this method when server, library, and table names are the same in both source and target environments.
For simplicity, we will refer to those two steps as export and import.
You can only export the JSON file for a folder. Exporting individual reports via GUI is not supported. Because this GUI is only available in VA 8.2, it only applies when exporting from another VA 8.2 environment. If exported reports have images, they will be included automatically in the JSON file.
Import via GUI is not exclusive for content coming from VA 8.2. Content (JSON file) coming from VA 8.1 can also be imported via GUI into VA 8.2.
Documentation about EV GUI for exporting and importing JSON files is available in SAS® Viya™ 3.3 Administration: Content Management.
/* setting up profiles and authentication tokens: commands executed in VA 8.2 CAS controller (microservices) node */ sas-admin --profile <source81or82> profile init /* only once */ sas-admin --profile <source81or82> auth login /* good for up to 10 hours, needs admin access to source */ sas-admin --profile <target82> profile init /* only once */ sas-admin --profile <target82> auth login /* good for up to 10 hours, needs admin access to 8.2 */ /* getting content from 8.x: commands executed in VA 8.2 CAS controller (microservices) node */ sas-admin --profile <source81or82> transfer export -u <content_uri> -n <package_name> sas-admin --profile <source81or82> transfer download --id <package_id> -f <json_file> /* adding content to 8.2: commands executed in VA 8.2 CAS controller (microservices) node */ sas-admin --profile <target82> transfer upload -f <json_file> -m <mapping_file> sas-admin --profile <target82> transfer import -m <mapping_file> --id <package_id>
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.