Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks Extension and Connector for MES 7​.1

Move a Work Tasks configuration to another environment

Move a Work Tasks configuration to another environment

  • Last UpdatedFeb 23, 2026
  • 7 minute read

This procedure only applies if you are creating a new production environment based on an existing development environment. If you are attempting to move workflows from a development environment to an existing production environment, you should use the Work Tasks workflow packages feature to import the workflows to the production environment.

For information about creating and importing workflow packages, see "Packages" in the Work Tasks Developer documentation, which is available in the Work Tasks help (https://docs.aveva.com).

Prerequisites

When moving Work Tasks configurations from one environment to another, observe the following prerequisites:

  • Both environments are running the same versions of Work Tasks, MES, and MES Connector.

  • Both environments are running SQL Server 2012 or later.

  • Ideally, both environments are running the same version of SQL Server. If they are running different versions of SQL Server, the destination environment must have the later version.

  • Both environments have Chrome or Microsoft Edge installed.

Recommendations

  • Use the same unique environment name (UEN) and repository name in both the development and production environments.

Assumptions about the source environment

  • MES users are configured.

  • MES is configured with the required entities, items, and so on that will be used in the production environment.

  • The Work Tasks farm and repository for MES are set up.

  • MES Connector is configured.

  • MES workflows are created and tested to ensure that MES, Work Tasks, and MES Connector are fully functional in this environment.

Assumptions about your experience

Only attempt to move a Work Tasks configuration to another environment only if you have experience installing and configuring Work Tasks, MES, and the MES Connector.

Move the Work Tasks and MES databases to the destination environment

  1. In both environments, stop the MES Service.

  2. In both environments, stop the Work Tasks service by stopping the Work Tasks – Client Service.

    This should stop all the other Work Tasks-related services. If any services continue to run, stop each of them manually.

  3. In the source environment, use SQL Server Management Studio to create backups of the Work Tasks farm and repository databases, and the MES database.

  4. Copy the database backup files to the SQL Server node in the destination environment.

  5. If for some reason the destination environment already has Work Tasks and MES databases, create backup copies and then delete the databases from the destination environment.

    This ensures you can restore the old databases if there is a problem moving the Work Tasks configuration.

  6. In the destination environment, use SQL Server Management Studio to restore the Work Tasks farm and repository databases, and the MES database.

    During the restore, you will typically use the same database names. However, you can rename the databases in the destination environment. If you do rename the databases, you will have to use these database names when configuring the MES Connector in the destination environment.

  7. Make sure that the database restorations are completed successfully.

  8. On the MES database in the destination environment, run the following SQL statements:

    TRUNCATE TABLE AWC_Workflowconnection

    TRUNCATE TABLE AWC_Workflowconnection_Status

Import the Work Tasks repository to the destination environment

Perform the following procedure in the destination environment.

  1. In SQL Server Management Studio, open the Query window.

  2. Copy the SQL statements below into the Query window.

    Replace the text in bold.

    -- Declaring variables

    DECLARE @OldRepositoryName AS NVARCHAR(150)

    DECLARE @OldUniqueEnvironmentName AS NVARCHAR(150)

    -- Set the Old Workflow repository name

    SET @OldRepositoryName = 'Replace this text with your repository name from the source machine'

    -- Set the Unique Environment name - The Unique Environment Name used to initially while provisioning the workflow repository from MES in engineering environment

    SET @OldUniqueEnvironmentName = 'Replace this text with your unique environment name from the source machine'

    -- Deleting all MES Connection details entries from MESConnectionDetails table

    DELETE FROM MESConnectionDetails WHERE RecordParentItemId IN

    (

    SELECT Id FROM SKExternalConnectionDetails where RecordParentItemId IN

    (

    SELECT Id FROM SKExternalConnections WHERE SourceType='MES' AND Application=@OldRepositoryName AND Title=@OldUniqueEnvironmentName

    )

    AND Application =@OldRepositoryName

    )

    -- Deleting all MES external connections details entries from SKExternalConnectionDetails table

    DELETE FROM SKExternalConnectionDetails WHERE RecordParentItemId IN (SELECT Id FROM SKExternalConnections WHERE SourceType='MES' AND Application=@OldRepositoryName AND Title=@OldUniqueEnvironmentName)

    AND Application=@OldRepositoryName

    -- Deleting all MES external connections information from SKExternalConnections table

    DELETE FROM SKExternalConnections WHERE SourceType='MES' AND Application =@OldRepositoryName AND Title=@OldUniqueEnvironmentName

    -- Deleting MES User resource mapping from SKESGResourceMapping table

    DELETE FROM SKESGResourceMapping WHERE UserId In(SELECT Id FROM SKVirtualActor WHERE Provider = @OldUniqueEnvironmentName AND ResourceHandler=@OldRepositoryName)

    AND Application=@OldRepositoryName

    -- Deleting mesuserprovider and mesroleprovider entries from SKEntityDataSourceProvider table

    DELETE FROM SKEntityDataSourceProvider WHERE Provider='mesuserprovider' OR Provider='mesroleprovider' AND Application=@OldRepositoryName AND InstanceName=@OldUniqueEnvironmentName

    -- Updating SKEEventAssociations table and Setting EventBindingXML with rootnodes where ever EventBindingXML is empty

    -- This step is required to avoid the 'Root Element is missing' message while attaching the datasource & creating a repository

    UPDATE SKEEventAssociations SET EventBindingXML = EventBindingXML + '</EventBind>' WHERE SUBSTRING(EventBindingXML,LEN(EventBindingXML)-11,12) != '</EventBind>' AND Application = @OldRepositoryName AND EventProviderName='MESEvents'

  3. Run the SQL statements on the repository database.

  4. Open the Work Tasks Farm Configuration Wizard.

  5. On the bottom left of the wizard, select the Work Tasks Farm Recovery link.

    The Recovery type page appears.

  6. Leave the default settings and select Next.

    The Connect to existing database page appears.

  7. Enter the database user account information.

  8. Select Test Connection to verify the database user account information entered.

  9. In the Server Name list, verify the node name of the server in the destination environment on which the farm database is installed.

  10. In the Replace Server list, select the server in the source environment from which the farm database was backed up.

    The recovery process will replace the source node name with the destination node name in the farm database.

  11. Select Test Connection to test the farm database configuration settings.

  12. If the connection test is successful, select Next.

  13. Wait until you see the message Farm database, Work Tasks Services and websites were recovered successfully.

    The page may display a status of Not Responding during recovery. No action is required. It may take from 1 to 10 minutes to do full recovery, depending upon the speed of the machine.

    Configure the MES database in the destination environment

    1. Open the post-install Configurator application by clicking the Configurator tile on the Start menu.

    2. Select the MES Database Setup component, modify the MES database server and database name if necessary, select Validate, and then select Configure.

      Selecting Configure before validating the database connection will result in an error message.

    3. Select the MES DB/MW Communication component, enter values for each tab, and then select Configure.

    4. Select the MES Middleware Proxy component, enter values for each tab, and then select Configure.

    5. Close the Configurator.

    6. Verify that the MES Middleware host service is running.

      Configure Work Tasks database and repository settings in the destination environment

      1. Import the cryptography settings from the source environment to the destination environment as follows:

        1. Copy the cryptography settings file (created during the initial installation of Work Tasks in the source environment) from the source machine to the destination machine.

        2. On the destination machine, open the Work Tasks Farm Configuration Wizard.

        3. Select Next.

        4. Select Cryptography Settings, and then select Next.

        5. In the Passphrase for the settings field, enter the same passphrase used on the source machine.

        6. Select Import.

        7. To confirm that you want to overwrite of the cryptography settings, select Yes.

        8. Navigate to the cryptography settings file copied from the source machine, choose the file, and then select Open.

        9. When the cryptography settings have been successfully imported, select OK.

        10. Select Finish to close the Work Tasks Farm Configuration Wizard.

      2. Configure the Work Task security settings on the destination machine as follows:

        1. Open the Work Tasks Farm Configuration Wizard.

        2. Select Next.

        3. Select Security Settings, and then select Next.

        4. Select the Secure Communication and Secure Web Sites settings to match the configuration found on the source machine.

        5. Verify that the appropriate certificate is shown, and then select Validate.

        6. When the the certificate is successfully validated, select OK.

        7. Select Configure.

        8. When the settings are successfully configured, select Yes.

        9. Work Task services must be restarted. Select OK to confirm essential Work Tasks services restart.

        10. Select Finish.

      3. Reset IIS and then open the Work Tasks Central Configuration page in administrative mode.

      4. Configure Work Task token service settings from the Central Configuration page as follows:

        1. Select Token Service Settings.

        2. Select the same configured token service configured on the source machine.

        3. Enter in the Registrar user and Password.

        4. Select Register.

        5. Select Central Configuration to return to the Central Configuration page.

      5. Go to the DataSource Settings page and make sure that the database name is the name of the new MES database in the production environment (that is, the MES database that was restored from the source environment).

      6. Select the Repository Settings link to open the Repository List page and make sure that the MES repository information is correct. For example, make sure that the Site Path URL is referring to the computer name of the node in the destination environment.

        Configure MES Connector in the destination environment

        1. Open the Work Tasks Connector Configuration utility.

        2. Configure the MES Connector for the destination environment.

          For more information about configuring the MES Connector, see the Work Tasks Extension and Connector for MES Installation Guide.

          Note: If authorization fails when starting the MES Connector configuration, relaunch the MES Connector configuration and try again.

        3. During the MES Connector configuration, if a message says that the Unique Environment Name (UEN) already exists, specify a new UEN.

        4. When saving the MES Connector configuration, if the message Port is already in use appears, stop and start (or restart) the MES Workflow Connector service in Windows Services.

          Migrate events to the destination environment

          To ensure migrated event references function correctly, do the following:

          1. On the source machine, open the MES\middleware\ MWDBMappingsCustom.xml file in a text editor.

          2. At the end of the file, copy the entire ext_hooks_objects XML tag section. It will begin with <ext_hooks_objects> and end with </ext_hooks_objects>.

          3. Open the new MWDBMappingsCustom.xml file on the destination machine and replace the ext_hooks_objects XML tag with the source machine data.

          4. Save the updated file.

          5. Restart the MES middleware.

            Verify the workflows in the destination environment

            1. In Enterprise Console, log in to the MES repository.

            2. Confirm that the workflows and other artifacts from the source environment are present.

            3. If you changed the UEN in the production environment from what it was in the source environment, complete the following steps for each workflow:

              1. If the workflow is published, unpublish it.

              2. Open the workflow in design mode.

              3. Update the UEN and node server name to those used in the destination environment.

              4. Save and close the workflow, or publish it.

            4. Close Work Tasks and restart the machine.

            5. Open Work Tasks and test run each workflow to make sure the expected data is stored in the MES database.

              TitleResults for “How to create a CRG?”Also Available in