最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Process for upgrading data to the latest Dynamics AX update

网络文摘 William 5238浏览 0评论

This article describes how to upgrade an older source database to run in a one-box demo or development environment for Microsoft Dynamics AX May 2016 update. The source database can be from Microsoft Dynamics AX CTP 7, Microsoft Dynamics AX CTP8, or the Microsoft Dynamics AX (February 2016) release. This process doesn’t apply to the upgrade of data in Management Reporter or the Retail channel database. It also doesn’t apply to the upgrade of document attachments that are stored in Microsoft Azure Blob storage.

Before you begin

  1. You must have a functional demo or development Microsoft Dynamics AX May 2016 Update 1 environment that is configured with a functional Dynamics AX application.
  2. Hotfix KB number 3170386, “Upgrade script error: ReleaseUpdateDB70_DMF. updateIntegrationActivityExecutionMessageIdPreSync,” must be installed.
  3. Hotfix KB number 3180871, “Data upgrade from RTW to Update 1 causes error when synchronizing PlanPlanActivitiesAggregate view”, must be installed. This is a binary hotfix which will cause the database synchronize process to fail.
  4. In your source database, verify that the SysSetupLog version number in the DESCRIPTION column is correct. The version number should be 170 if you’re upgrading from Dynamics AX CTP7, 180 if you’re upgrading from Dynamics AX CTP8, or 190 if you’re upgrading from Dynamics AX RTW.
    • Make sure that the SYSSETUPLOG table has the correct record.
    • If you’re upgrading from Dynamics AX CTP7, run the following Transact-SQL statement from Microsoft SQL Server Management Studio.
      IF NOT EXISTS (SELECT 'x' FROM SYSSETUPLOG WHERE DESCRIPTION = '170' and NAME = 'ReleaseUpdateDBgetFromVersion')
      BEGIN
      INSERT INTO SYSSETUPLOG (DESCRIPTION, NAME, VERSION, CREATEDDATETIME, CREATEDBY)
      VALUES ('170', 'ReleaseUpdateDBgetFromVersion', '7.0', '2016-01-01 00:00:00.000', 'Admin')
      END
    • If you’re upgrading from Dynamics AX CTP8, run the following statement from Management Studio.
      IF NOT EXISTS (SELECT 'x' FROM SYSSETUPLOG WHERE DESCRIPTION IN ('180', '183') and NAME = 'ReleaseUpdateDBgetFromVersion')
      BEGIN
      INSERT INTO SYSSETUPLOG (DESCRIPTION, NAME, VERSION, CREATEDDATETIME, CREATEDBY)
      VALUES ('180', 'ReleaseUpdateDBgetFromVersion', '7.0', '2016-01-01 00:00:00.000', 'Admin')
      END
    • If you’re upgrading from Dynamics AX RTW, run the following statement from Management Studio.
      IF NOT EXISTS (SELECT 'x' FROM SYSSETUPLOG WHERE DESCRIPTION = '190' and NAME = 'ReleaseUpdateDBgetFromVersion')
      BEGIN
      INSERT INTO SYSSETUPLOG (DESCRIPTION, NAME, VERSION, CREATEDDATETIME, CREATEDBY)
      VALUES ('190', 'ReleaseUpdateDBgetFromVersion', '7.0', '2016-01-01 00:00:00.000', 'Admin')
      END
  5. If you’re upgrading a database that began as a standard Microsoft Dynamics AX demo data database, you must also run the following script. This step is required because the demo data contains bad records for some kernel X++ classes.
    delete from classidtable where id >= 0xf000 and id <= 0xffff

Download the DataUpgrade.zip script

To obtain the latest DataUpgrade.zip package, from your target environment that is running Dynamics AX May 2016 Update 1, download the latest binary updates from Microsoft Dynamics Lifecycle Services (LCS).

  1. In LCS, in the Environments section, click your target Dynamics AX May 2016 Update 1 environment, scroll to the bottom of the page, and then click the Platform binary updates tile.
  2. On the Add hotfixes page, click Select all, click Add, and then click Download package.
  3. On the next page, click Download.
  4. After the package is downloaded, extract the contents, and go to the following directory to find the DataUpgrade.zip file: ..AOSServiceDSCPackagesfilesdynamicsax-framework-bin.7.0.4127.24083.zipCustomDeployablePackage

Note: Computers that are deployed from LCS will already have a DataUpgrade.zip file. However, that file is out of date and includes issues that have been resolved in later fixes. Always download the latest version of the file from LCS.

Remove encryption certification rotation

  1. Extract the DataUpgrade.zip deployable package to C:Temp or a location of your choice.
  2. Open the following file in a text editor: C:tempDataUpgradeRotateConfigDataServicingRotations.json file. Modify the file as shown here, and save it.
    This step is required only for one-box environments. Because you’re removing the need for encryption certificate rotations, old data in encrypted fields in your database will no longer be readable. This is a technical limitation for a one-box data upgrade. New data that goes into those fields after the upgrade is completed is unaffected. For details about the affected fields, see the “Encrypted fields in demo data” section later in this article.

    {
         "AosService": {
                           "EncryptionThumbprint": null,
                           "SigningThumbprint": null,
                           "Certificates": [
                                           ],
                           "CertificateThumbprints": [
                                          ],
                           "KeyValues": [
                                          ]
                       }
    }sec
  3. Run the Windows PowerShell Integrated Scripting Environment (ISE) as an administrator.
  4. Open C:TempDataUpgradeRotateConfigDataScriptsEncryptRotationConfigData.ps1.
  5. Press F5 to run the script.

Fix the duplicate key issue (February 2016 release only)

This step is required if you’re upgrading a database from the Dynamics AX (February 2016) release to Dynamics AX May 2016 Update 1.

  1. Open the following file in a text editor: C:TempDataUpgradeAosServiceScriptsAutoDataUpgradePreReqs.ps1
  2. Comment out or remove the following line.
    Invoke-SQL -sqlCommand:$adjustsqlseq
  3. Save the file.

Upgrade the database

  1. Install the deployable package from the C:TempDataUpgrade folder. Use the instructions in the Install a deployable package article.
  2. Restore a backup of the source database to your Update 1 one-box demo or development environment.
    Note: For better upload/download speed between Azure virtual machines (VMs), we recommend that you use AzCopy. For details about how to download and use AzCopy to copy to or from an Azure Blob store, see Transfer data with the AzCopy Command-Line Utility.
  3. Run the runbook file until Step 4: GlobalBackup.
  4. Rename the existing Update 1 database, and replace it with the source database that you want to upgrade.
    ALTER DATABASE <Update1_AX_DATABASENAME> MODIFY NAME = <Update1_AX_DATABASENAME>_ORIG
    ALTER DATABASE <Source_AX_DATABASENAME> MODIFY NAME = <Update1_AX_DATABASENAME>
  5. Create a backup of the source database, in case you need to revert to it, because the following steps will modify the source database.
  6. Mark step 4 of the runbook completed, and continue to run the runbook until it’s completed.
    Notes:

    • The steps after step 4 of the runbook run the upgrade scripts.
    • If there is data in any staging tables that are used by data management, this step fails, and you receive the following error message:

      Staging tables should be empty in order to proceed with the data upgrade. Please run the DeleteScriptForStagingTables.sql by carefully reviewing the script in order to remove the data from the staging tables.

      In this case, run DeleteScriptForStagingTables.sql to clean up the staging tables. You can find this script under AOSServiceScripts in your data upgrade folder. After the script has finished running, rerun this step.

Known issues

The system fails to locate or generate a user GUID

You might receive the following error message:

…Unhandled exception More Information: System failed to locate or generate a user GUID…

In this case, rerun the runbook step that failed. You will then be able to continue.

KB number 3170386

If KB number 3170386 isn’t installed, you will receive the following error message:

GlobalUpdate script for service model: AOSService on machine …. Etc

…. UpgradeServiceHelper::WaitForDataUpgradeToComplete(Object[]…

The step failed

This error is caused by a failure in the pre-sync or the post-sync substep of the data upgrade. You can use the following steps to determine which substep failed and the details of the failure:

Note: You can’t rerun the failed runbook step until the pre-sync or post-sync substep has been manually completed and the AutoDataUpgrade.config file has been updated to skip the substeps that have already been run.

  1. In File Explorer, in the …DataUpgradeAosServiceScripts folder, sort by descending order of date modified, and then look at the file at the top of the list to determine which substep failed.
    • If the top file is named dbUpgradePreSyncMonitor.error.log, the pre-sync substep failed.
    • If the top file is named dbUpgradePostSyncMonitor.error.log, the post-sync substep failed.
  2. In Management Studio, run the following SELECT statement.
    SELECT * FROM RELEASEUPDATELOG

    The second-to-last record in the result set will have the errors and call stacks for all the failures.

DMF errors

If you receive either of the following Data Migration Framework (DMF) errors, download Hotfix KB number 3170386, and restart the upgrade process.

DMF PreSync

Batch error: initial.DAT.ReleaseUpdateDB70_DMF.updateIntegrationActivityExecutionMessageIdPreSync (Batch:AOS-F01B9F0CCC8, 9, Info, Error, ):[[1][3,Cannot execute the required database operation.

The SQL database has issued an error.][3,Object Server DynamicsAXBatchManagement: ][3,[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ‘GO’.][3,

DMF PostSync

Batch error: initial.DAT.ReleaseUpdateDB70_DMF.updateIntegrationActivityExecutionMessageIdPostSync (Batch:AOS-F01B9F0CCC8, 9, Info, Error, ):[[1][3,Cannot execute the required database operation.The SQL database has issued an error.][3,Object Server DynamicsAXBatchManagement: ][3,[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ‘GO’.][3,

Encrypted fields in demo data

After upgrade, values in encrypted fields in the database will be unreadable. However, new values that are entered in these fields after upgrade will be readable. This behavior occurs because of a technical limitation that is related to the certificate that is used for data encryption.

The following table shows the fields that are affected.

Table.Field Data exists in demo data
CreditCardAccountSetup.SecureMerchantProperties Yes
ExchangeRateProviderConfigurationDetails.Value Yes
RetailChannelPaymentConnectorLine.SecureMerchantProperties Yes
RetailConnDatabaseProfile.ConnectionString Yes
RetailHardwareProfile.SecureMerchantProperties Yes
RetailHardwareProfileMerchantInfoEntity.SecureMerchantProperties Yes
FiscalEstablishment_BR.ConsumerEFDocCsc No
FiscalEstablishmentEntity.CSC No
FiscalEstablishmentStaging.CSC No
HcmPersonIdentificationNumber.PersonIdentificationNumber No
HcmWorkerActionHire.PersonIdentificationNumber No
SysEmailSMPTPassword.Password No
SysOAuthUserTokens.EncryptedAccessToken No
SysOAuthUserTokens.EncryptedRefreshToken No

转载请注明:ww12345678 的部落格 | AX Helper » Process for upgrading data to the latest Dynamics AX update

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址