Skip to main content

Notifications

Resolution to Cloud Migration Error - Enable Change Tracking in DB

Introduction:

While I was trying to upgrade BC14 On-Premise to BC22 Saas, I noticed the following error in Cloud Migration Setup.

Business Central Cloud Migration Error "Change tracking must be enabled in the source database with a recommended retention period of at least three days"

This blog provides a step-by-step guide on how to resolve this issue.

To know how to setup Cloud Migration follow the link - Cloud Migration Setup



Pre-requisites:

  • Understanding of Cloud Migration
  • Business Central v14 On-Premise
  • Business Central Saas Subscription

Books & References:

https://www.olisterr.tech/2022/03/migrating-data-from-business-central-on.html

https://learn.microsoft.com/en-us/sql/relational-databases/track-changes/about-change-tracking-sql-server?view=sql-server-ver16

Demonstration: 

1. Error scenario: While setting up the Cloud migration with BC On-premise to BC Saas, I got the error 
Change tracking must be enabled in the source database with a recommended retention period of at least three days.

I tried clearing logs and restarting the SQL Server but I kept on getting this error consistently.


2. Resolution: Upon a quick Google search it was clear that a configuration in Database had to be changed.
I ran the SQL query as follows

 ALTER DATABASE BC140TEST
SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 5 DAYS, AUTO_CLEANUP = ON);

GO

However, I was presented with another error from SQL DB.


Knowing that Change Tracking is enabled but probably the retention period is shorter than 3 days.
Hence, I right-clicked on DB > Properties > Change Tracking I found where we can change the configuration.


I changed the Retention period to 3 Days and tried again.
I was able to connect.

Conclusion:

Change tracking is needed to identify the changes that happened in SQL DB.
By default Business Central Cloud Migration requires 3 Days of change tracking enabled.

I hope this helps




This was originally posted here.

Comments

*This post is locked for comments