Copy Security

Bobbie C. Moreland
Sr. Technical Architect
Baylor Health Care System


Below find documentation and links to 2 scripts, secunld.sh and secload.sh, that will copy security from one productline to another. Both productlines should be in the 7.0.8 environment.

As noted in the instructions, the scripts need to be modified to fit your environment.

Note: I have used slightly modified versions of the secunld.sh and secload.sh scripts to copy security from a productline in the 7.0.8 Environment to one in a 7.3.3 environment. I did it by not loading the locale and usercnv tables, and also by adding an empty column to the end of the USER csv file.

The standard disclaimers apply. Use at your own risk. Run on a test system first. Make backups of affected systems before running.

As of Environment version 7.3 you can use the following Lawson utilities to copy security:

  1. secdump
  2. secload
  3. bldsecdict


  1. Logon as Lawson Administrator to the server that you are going to copy the security from.

  2. Turn off security:

    lawsec off

  3. Edit secunld and make the following changes to reflect your environment:

    • Edit the line under the section that says

      Need to set correct Environment variables within script for Lawson Environment variables are used within script, to make moving easier

      Put in the path to your environment configuration file

      . /lawson/lawson/lawson.env

    • Edit the line under the section that says

      Set the working directory to output the security data file extracts within validate that script variables are set within the script

      Put in a valid directory path.

      SECDIR=/Directory_Path

    • Page down till you find the following:

      sed 's/TST2/TST1/g' $SECDIR/secclass.$TIMESTAMP > $SECDIR/secclass.csv

      Edit to reflect your productlines. The productline names must be in upper case

      sed 's/FROM_PRODLINE/TO_PRODLINE/g' $SECDIR/secclass.$TIMESTAMP > $SECDIR/secclass.csv

  4. At the command line, run:

    ./secunld From_Productline To_Productline

    For example:

    ./secunld prod test

  5. The script will create a tar file called secure.tar in the SECDIR you specified above.

  6. Edit secload and make the following changes to reflect your environment:

    • Edit the line under the section that says

      Need to set correct Environment variables within script for Lawson Environment variables are used within script, to make moving easier

      Put in the path to your environment configuration file

      . /lawson/lawson/lawson.env

    • Edit the line under the section that says

      Set the working directory to output the security data file extracts within validate that script variables are set within the script

      Put in a valid directory path.

      SECDIR=/Directory_Path

    • Edit the line under the section that says

      Now the Security dictionary needs to be rebuilt

      Plug in your productline and environment names

      bldsecdict -d PRODUCTLINE

  7. Before loading security information with secload, make an online backup of all affected GEN files. One way to accomplish this would be to run something like the following.


    for secfile in `echo SECCLASS USER USEREXE USERKEY USERMENU USERPROD USERRECLVL USERSCR USERCAT USERFILE USERFLD LOCALE USERCNV USERTAB`
    do
          echo $secfile
          cp $LADBDIR/GEN/${secfile}*   /some/safe/directory/somewhere
    done

  8. Load security information

    ./secload

  9. The script will process the secure.tar file and load security records into the security dictionary.

  10. Turn security back on:

    lawsec on

  11. This completes the process of copying security.


Back   Home