With every upgrade to ENOVIA SmarTeam (not to mention upgrades to CAD, Office and database platforms) there’s no question about the benefits of building a test environment for validation prior to a production roll-out. An important piece of building a test environment is a properly configured test vault. Quite often, a successful test doesn’t require a complete copy of the entire production vault, so let’s take a look at a simple process to copy specific files from a production system to a test environment on demand.
To get started, build a working ENOVIA SmarTeam test environment with a copy of the production database, scripts, configuration files, NLS files, and icons. Identify and configure the test vaults you’ll be copying the files to. Important Note: When building a test environment, ensure that the ENOVIA SmarTeam Vault Server Setup tool is pointing to the newly created test vaults and not the production vaults. To keep things simple, the example script for this article (request the free sample code by contacting us) has just three possible destination vaults: Checked In, Released, and Obsolete. Record the UNC paths of each of these destination (test) vaults and setup NTFS permissions on them so that the logged-in Windows user has write access.
Note that this script will copy files for each object selected. It will not copy other revisions of selected objects, nor will it automatically copy any linked objects (such as SolidWorks models if a drawing is selected). The tool will, however, copy viewer files automatically (like PDFs used for rendition management).
Step One – Create the script file
Create a script file named CopyFilesToTest.bs in the script folder on the production environment.
Step Two – Copy the code to the script file
Open the script file you received from Razorleaf and copy/paste the text to the newly created CopyFilesToTest.bs script file.
Step Three – Modify Destination Vaults
The three destination vaults must be configured to match the location of the vaults on your test SmarTeam Vault Server. The code that configures this is as follows:
CheckedInVault = “\\UNCPathToCheckedIn”
ReleasedVault = “\\UNCPathToReleased”
ObsoleteVault = “\\UNCPathToObsolete”
The screenshot below shows a sample configuration:
Note that the full UNC path must be enclosed within quotations. Remember to configure NTFS permissions to allow the logged-in Windows user to write to the UNC paths.
Step Four – Hook the script
Hook the script function to a User-Defined Tool (UDT) on the Documents super class in ENOVIA SmarTeam using the Script Maintenance tool.
Step Five – Run the Script
Finally, identify objects for the file transfer. This can be either from browsing a Documents tree or performing a search. CTRL or SHIFT + left-click to select one or more objects. Once the desired objects are selected, simply right-click, select User Defined Tools and choose Copy Files to Test.
A confirmation message will be shown if successful.
Browse to the SmarTeam Vault Server test location using Windows Explorer to ensure the files were copied as expected. Since the CopyFilesToTest.bs script is installed on the production environment, permissions should be set on the UDT to only allow access to an administrator.
With the test files copied, validation can begin in the test system using copies instead of the actual production files. Not only is this a time saver, but user acceptance testing can be performed on files familiar to the users.