There may be occasions where bulk creating Device Director profiles straight into the database is necessary, for example during environment migrations. This process is possible, however due to the BLOB values and table links needed, it is advised that client databases are backed up and the following process carried out on a test environment first.
Attached is an example SQL script, based on information provided by the Device Director development team. The script uses variables to minimise the need for too much customer-specific database information to be configured into the script.
DeviceDirector_Bulk_Profile_Creation.sql
Before we get into the specifics of how to create the script, it is good to know how the tables link:
Each profile requires a value within the Profile table, with parameters of the profile linking within Profile_Parameter.
Creating the Script
As an example, we will be creating Vantage profiles:
In the Device Director UI, it is always beneficial to firstly attempt to create the desired profile here. This will help outline the relevant parameters needed. Creating a new Vantage profile will require information on 3 parameters:
As illustrated above, the Priority parameter has a default value of 5. Therefore, the profile creation script will only need to take into account Name and Workflow.
The profile_parameter_type table is useful, because it helps to showcase the parameter Type_ID (i.e., the value in the ID field above). In addition to the TRANSCODER_TYPE value which is needed when creating the profile in the profile table.
NOTE: If you're unsure which fields in the parameter_type table are needed, create a new profile within the Device Director UI for the device of your choice. Then check the 'Profile_Parameter' table for your new 'Profile_ID'. Each Type_ID linked to your unique 'Profile_ID', will outline the parameter types needed.
Due to the parameter values being stored in the database as BLOB, it is fundamental that the values being input are processed through the Blobber tool (This tool is NOT released and should only be used internally).
Simply copy the above hex value and use this as your value in the script.
Using the information compiled from above, a basic Vantage profile creation script can be created. Please see Device Director - Creating Vantage Profiles.sql for more information.
To make the script beneficial on a wider scale, firstly understand how many profiles need to be created and of what device type. Create the relevant variables in the script for profile parameters and type. Use the Blobber tool to translate values to hex. Then finally use excel and create a CONCAT formula to input the profile names into the profile name elements.
For low numbers of profile creation, it is advised that this is done manually. However, for large numbers and potentially over multiple environments, using the above can save time and ensure consistency.