One of the features that came with the fall release of Microsoft Dynamics 365 Business Central enables users whose primary business is in an on-premises system to replicate their data into a cloud environment so that they may try out cloud-only features with their real data. This is set up through the Intelligent Cloud Setup wizard within Assisted Setup. With a few clicks, some information about the on-premises system, and a couple of minutes, users can start replicating hundreds of tables into their cloud environment. However, there can be some hiccups to get through before all the data can start moving smoothly. A common scenario that we see partners and customers facing is seeing this error when they try to run their replication: Failure preparing data for table. Error message: Change tracking is not enabled on table 'My Table'. The image below shows what that looks like when you go to the table failures for a given replication run. Why do I need to enable change tracking? You might be wondering why we need change tracking for this feature anyway. Enabling change tracking gives SQL developers the ability to find out exactly what changed on a given table between two change versions. So let's say you run an initial replication and 100k G_L Entry records get moved to the cloud database. In this example, assume you have a daily schedule to run the replication. If you add or change 1000 G_L Entry records every day, then by using change tracking, the replication process can determine which 1000 records have changed and just move those with each daily replication. Without change tracking, the replication process wouldn't know what changed and would, therefore, have to move all of the records every time. Sounds pretty inefficient, right? It would be. Why isn't it already enabled? Initially, we wanted to always enable change tracking so that users wouldn't be faced with these types of errors. However, we found that there were some performance issues with enabling it all the time for all environments. Mostly because it does take some time to enable change tracking on several thousand SQL tables. In a future update, we have implemented a few improvements for enabling it. One is where we will attempt to enable it on-the-fly during the replication process if it's not already enabled. As long as the SQL user provided in the connection string has permission, it will happen automatically. The other thing that we added and will come later is a new action in the on-premises system that will go through and enable change tracking on all of the tables enabled for replication. What can I do to fix the error? Enabling change tracking manually for over a thousand SQL tables would be very time consuming. The good news is that we can tell exactly which tables are enabled for replication by looking at the Intelligent Cloud Status table. Using the contents of that table, we can use a script to iterate through each table and enable change tracking on it. Here is an example of how to do that: DECLARE @ReplicatedTables AS TABLE (Id int, [Table Name] nvarchar(128)) INSERT INTO @ReplicatedTables SELECT ROW_NUMBER() OVER (ORDER BY [Company Name], [Table Name]), [Table Name] FROM [Intelligent Cloud Status] DECLARE @i int = 0, @modifiedCount int = 0 DECLARE @count int = (SELECT COUNT(*) FROM @ReplicatedTables) WHILE @i < @count BEGIN SET @i += 1 DECLARE @TableName nvarchar(128) SELECT @TableName = [Table Name] FROM @ReplicatedTables WHERE Id = @i IF EXISTS(SELECT TOP 1 1 FROM sys.tables WHERE name = @TableName) IF NOT EXISTS(SELECT TOP 1 1 FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(@TableName)) BEGIN DECLARE @sql nvarchar(250) SET @sql = 'ALTER TABLE ' + QUOTENAME(@TableName) + ' ENABLE CHANGE_TRACKING' EXEC sp_executesql @sql SET @modifiedCount += 1 END END SELECT 'Enabled change tracking on ' + CAST(@modifiedCount as nvarchar(12)) + ' tables.' Since this code uses the values inside of Intelligent Cloud Status, you should be able to copy+paste it and run it with success. Though, I highly recommend reviewing it first before you run it. Once you've done so, you can choose to run replication manually from the Intelligent Cloud Management page in the cloud system and see if it all worked. I hope that helps get you up and running with the Intelligent Cloud. If you have any questions or comments about it, we'd love to hear from you in the comment section below.