{"id":723,"date":"2019-06-21T21:13:10","date_gmt":"2019-06-21T21:13:10","guid":{"rendered":"https:\/\/ricardomoinhos.com\/?p=723"},"modified":"2021-09-29T10:01:04","modified_gmt":"2021-09-29T09:01:04","slug":"c-side-to-al-table-data-migration","status":"publish","type":"post","link":"https:\/\/ricardomoinhos.com\/pt\/c-side-to-al-table-data-migration\/","title":{"rendered":"C\/SIDE to AL Table Data Migration"},"content":{"rendered":"<p>In the last weeks I&#8217;ve read a few posts about C\/SIDE to AL Data Migration and as far as I understand people are struggling to have data migrated from C \/SIDE to AL tables.<\/p>\n<p>Data upgrade codeunits to the rescue. They exist in C\/AL and exists in AL as well so you should use and abuse them.<\/p>\n<p>If you ever made a data upgrade then you should be familiar with upgrade codeunits but if you don\u2019t, please feel free to ask me for help.<\/p>\n<p>Let&#8217;s take a look at the following scenario:<\/p>\n<p>I have two tables in C\/AL with dummy data and I want to convert them to extensions. I need to migrate the data from the C \/AL table to the new AL table.<br \/>\n* Table 50000 &#8211; Dummy Data To Migrate<br \/>\n* Table 50001 &#8211; Dummy Data To Migrate 2<\/p>\n<p>In table 50000 the field ids are the same. In table 50001 the ids don\u2019t match the final table ids but the fields name do so both scenarios are very similar. I\u2019ll show you how to handle it.<\/p>\n<p>Please consider the following steps:<\/p>\n<ol>\n<li>Create two C\/AL tables and populate them with dummy data.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-710\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-28.jpg\" width=\"577\" height=\"108\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-28.jpg 577w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-28-300x56.jpg 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-703\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-29.jpg\" width=\"448\" height=\"264\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-29.jpg 448w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-29-300x177.jpg 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-706\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-30.jpg\" width=\"387\" height=\"266\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-30.jpg 387w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-30-300x206.jpg 300w\" sizes=\"auto, (max-width: 387px) 100vw, 387px\" \/><\/p>\n<ol>\n<li>The new AL tables will have the same table id and\/or the same name so we need to create new tables to temporarily hold the data and use data migration codeunits to migrate the data from the original to the upgrade (temp) tables.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-705\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-31.jpg\" width=\"635\" height=\"143\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-31.jpg 635w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-31-300x68.jpg 300w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\" \/><\/p>\n<p>New 70000 and 70001 tables are copies of the original ones.<\/p>\n<ol>\n<li>Create a new upgrade codeunit to move the data from the original tables to the upgrade (temp) tables:<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-704\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-32.jpg\" width=\"569\" height=\"90\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-32.jpg 569w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-32-300x47.jpg 300w\" sizes=\"auto, (max-width: 569px) 100vw, 569px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-716\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-33.jpg\" width=\"1427\" height=\"551\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-33.jpg 1427w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-33-300x116.jpg 300w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-33-768x297.jpg 768w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-33-1024x395.jpg 1024w\" sizes=\"auto, (max-width: 1427px) 100vw, 1427px\" \/><\/p>\n<blockquote><p>[TableSyncSetup] GetTableSyncSetupW1(VAR TableSynchSetup : Record &#8220;Table Synch. Setup&#8221;)<br \/>\n\/\/ The purpose of this method is to define how old and new tables will be available for dataupgrade<\/p>\n<p>\/\/ The method is called at a point in time where schema changes have not yet been synchronized to<br \/>\n\/\/ the database so tables except virtual tables cannot be accessed<\/p>\n<p>\/\/ TableSynchSetup.&#8221;Table ID&#8221;:<br \/>\n\/\/ Id of the table with schema changes (i.e the modified table).<\/p>\n<p>\/\/ TableSynchSetup.&#8221;Upgrade Table ID&#8221;:<br \/>\n\/\/ Id of table where old data will be available in case the selected TableSynchSetup.Mode option is one of Copy or Move , otherwise 0<\/p>\n<p>\/\/ TableSynchSetup.Mode:<br \/>\n\/\/ An option indicating how the data will be handled during synchronization<br \/>\n\/\/ Check: Synchronize without saving data in the upgrade table, fails if there is data in the modified field\/table<br \/>\n\/\/ Copy: Synchronize with saving data in the upgrade table, the modified table contains data in matching fields<br \/>\n\/\/ Move: Synchronize with moving the data in the upgrade table,the changed table is empty; the upgrade logic is handled only by application code<br \/>\n\/\/ Force: Synchronize without saving data in the upgrade table, disregard if there is data in the modified field\/table<\/p>\n<p>DataUpgradeMgt.SetTableSyncSetup(DATABASE::&#8221;Dummy Data To Migrate&#8221;,DATABASE::&#8221;Temp Dummy Data To Migrate&#8221;,TableSynchSetup.Mode::Move);<br \/>\nDataUpgradeMgt.SetTableSyncSetup(DATABASE::&#8221;Dummy Data To Migrate 2&#8243;,DATABASE::&#8221;Temp Dummy Data To Migrate 2&#8243;,TableSynchSetup.Mode::Move);<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-707\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-34.jpg\" width=\"303\" height=\"186\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-34.jpg 303w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-34-300x184.jpg 300w\" sizes=\"auto, (max-width: 303px) 100vw, 303px\" \/><\/p>\n<p>Codeunit subtype must be set to Upgrade.<\/p>\n<ol>\n<li>At this moment, you will be able to delete the original tables without forcing it because a data upgrade codeunit has been created to handle and move the data.<\/p>\n<\/li>\n<li>\n<p>Delete tables 50000 and 50001 and choose &#8220;Now &#8211; with validation&#8221; option;<\/p>\n<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-712\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-35.jpg\" width=\"650\" height=\"389\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-35.jpg 650w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-35-300x180.jpg 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/p>\n<ol>\n<li>The tables are deleted without any issue;<\/li>\n<li>Run the temporary tables and check that the data has been copied from the original to the temporary tables;<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-708\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-36.jpg\" width=\"359\" height=\"263\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-36.jpg 359w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-36-300x220.jpg 300w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/p>\n<ol>\n<li>Now create the AL extension with the two original tables. For the sake of simplicity I&#8217;ve created the following tables in AL:<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-711\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-37.jpg\" width=\"449\" height=\"618\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-37.jpg 449w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-37-218x300.jpg 218w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/p>\n<blockquote><p>table 50100 &#8220;Dummy Data To Migrate&#8221;<\/p>\n<p>{<\/p>\n<p>Caption = &#8216;Dummy Data To Migrate&#8217;;<\/p>\n<p>fields<\/p>\n<p>{<\/p>\n<p>field(1; &#8220;Dummy Field 1&#8221;; Code[10])<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>field(2; &#8220;Dummy Field 2&#8221;; Code[10])<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>field(3; &#8220;Dummy Field 3&#8221;; Code[10])<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>keys<\/p>\n<p>{<\/p>\n<p>key(Key1; &#8220;Dummy Field 1&#8221;)<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-713\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-38.jpg\" width=\"449\" height=\"627\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-38.jpg 449w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-38-215x300.jpg 215w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/p>\n<blockquote><p>table 50101 &#8220;Dummy Data To Migrate 2&#8221;<\/p>\n<p>{<\/p>\n<p>Caption = &#8216;Dummy Data To Migrate 2&#8217;;<\/p>\n<p>fields<\/p>\n<p>{<\/p>\n<p>field(50000; &#8220;Dummy Field 3&#8221;; Code[10])<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>field(50001; &#8220;Dummy Field 2&#8221;; Code[10])<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>field(50002; &#8220;Dummy Field 1&#8221;; Code[10])<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>keys<\/p>\n<p>{<\/p>\n<p>key(Key1; &#8220;Dummy Field 1&#8221;)<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p><\/blockquote>\n<p>Please note that in &#8220;Dummy Data To Migrate 2&#8221; table the field ids are not equal and are sorted differently.<\/p>\n<ol>\n<li>Publish the extension;<\/li>\n<li>To migrate the data from the temporary tables to the extension tables, create a data upgrade codeunit in AL:<\/li>\n<\/ol>\n<blockquote><p>codeunit 50100 &#8220;Data Upgrade Codeunit&#8221;<\/p>\n<p>{<\/p>\n<p>Subtype = Upgrade;<\/p>\n<p>trigger OnRun()<\/p>\n<p>begin<\/p>\n<p>end;<\/p>\n<p>trigger OnUpgradePerCompany()<\/p>\n<p>begin<\/p>\n<p>DummyTable1_DataCopy;<\/p>\n<p>DummyTable2_DataCopy;<\/p>\n<p>end;<\/p>\n<p>local procedure DummyTable1_DataCopy()<\/p>\n<p>var<\/p>\n<p>DestinyTable: Record &#8220;Dummy Data To Migrate&#8221;;<\/p>\n<p>OriginTable: Record &#8220;Temp Dummy Data To Migrate&#8221;;<\/p>\n<p>begin<\/p>\n<p>With OriginTable do begin<\/p>\n<p>if FindSet() then<\/p>\n<p>repeat<\/p>\n<p>DestinyTable.Init();<\/p>\n<p><span style=\"font-size: inherit;\">DestinyTable.Transferfields(originTable);<\/span><\/p>\n<p><span style=\"font-size: inherit;\">DestinyTable.Insert;<\/span><\/p>\n<p>until next = 0;<\/p>\n<p>\/\/DeleteAll();<\/p>\n<p>end;<\/p>\n<p>end;<\/p>\n<p>local procedure DummyTable2_DataCopy()<\/p>\n<p>var<\/p>\n<p>DestinyTable: Record &#8220;Dummy Data To Migrate 2&#8221;;<\/p>\n<p>OriginTable: Record &#8220;Temp Dummy Data To Migrate 2&#8243;;<\/p>\n<p>begin<\/p>\n<p>With OriginTable do begin<\/p>\n<p>if FindSet() then<\/p>\n<p>repeat<\/p>\n<p>DestinyTable.Init();<\/p>\n<p>DestinyTable.&#8221;Key Field 1&#8243; := OriginTable.&#8221;Key Field 1&#8243;;\u00a0 \/\/ Add all the key fields.<\/p>\n<p>DestinyTable.&#8221;Dummy Field 1&#8243; := OriginTable.&#8221;Dummy Field 1&#8243;;<\/p>\n<p>DestinyTable.&#8221;Dummy Field 2&#8243; := OriginTable.&#8221;Dummy Field 2&#8243;;<\/p>\n<p>DestinyTable.&#8221;Dummy Field 3&#8243; := OriginTable.&#8221;Dummy Field 3&#8221;;<\/p>\n<p>DestinyTable.Insert;<\/p>\n<p>until next = 0;<\/p>\n<p>\/\/DeleteAll();<\/p>\n<p>end;<\/p>\n<p>end;<\/p>\n<p>}<\/p><\/blockquote>\n<p>i. Two issues should arise:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-709\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-39.jpg\" width=\"695\" height=\"139\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-39.jpg 695w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-39-300x60.jpg 300w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-size: inherit;\"> 1) VSCode cannot find \u201cDummy Data To Migrate&#8221; nor &#8220;Dummy Data To Migrate 2&#8221; tables.<br \/>\nTo fix this, you must set dependencies with the extension created earlier.<br \/>\nIn the app.json, setup the dependencies:<\/span><\/p>\n<blockquote style=\"padding-left: 40px;\">\n<p style=\"padding-left: 40px;\"><span style=\"font-size: inherit;\">&#8220;dependencies&#8221;: [<\/span><\/p>\n<p style=\"padding-left: 40px;\">{<\/p>\n<p style=\"padding-left: 40px;\">&#8220;appId&#8221;: &#8220;6fbcc681-a68a-46bc-ab7c-87c7434fdd06&#8221;,<\/p>\n<p style=\"padding-left: 40px;\">&#8220;name&#8221;: &#8220;DataMigrationArticle&#8221;,<\/p>\n<p style=\"padding-left: 40px;\">&#8220;publisher&#8221;: &#8220;Default publisher&#8221;,<\/p>\n<p style=\"padding-left: 40px;\">&#8220;version&#8221;: &#8220;1.0.0.0&#8221;<\/p>\n<p style=\"padding-left: 40px;\">}<\/p>\n<p style=\"padding-left: 40px;\">],<\/p>\n<\/blockquote>\n<p style=\"padding-left: 40px;\">2) VSCode cannot find &#8220;Temp Dummy Data To Migrate&#8221;.<\/p>\n<p style=\"padding-left: 40px;\">This is related with the symbols generation because this table was created in C\/AL and must be accessed in AL. Please refer to the following website:<\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/dynamics365\/business-central\/dev-itpro\/developer\/devenv-running-cside-and-al-side-by-side\">https:\/\/docs.microsoft.com\/en-us\/dynamics365\/business-central\/dev-itpro\/developer\/devenv-running-cside-and-al-side-by-side<\/a><\/p>\n<p style=\"padding-left: 40px;\">You need to run the Microsoft Dynamics NAV Development Environment with the <em>generatesymbolreference<\/em> flag set as true and compile both 70000 and 70001 tables.<\/p>\n<blockquote style=\"padding-left: 40px;\">\n<p style=\"padding-left: 40px;\">finsql.exe generatesymbolreference=yes<\/p>\n<\/blockquote>\n<p style=\"padding-left: 40px;\">Please let me know if you have any doubts.<\/p>\n<p style=\"padding-left: 40px;\">3) Download the symbols again in VS Code after following the previous steps and you should have no errors in the project.<\/p>\n<ol>\n<li>Publish the upgrade extension and install it.<\/li>\n<\/ol>\n<p>I&#8217;ve packaged the extension in VSCode and used Powershell to publish and install it but you can do it directly from VSCode if you want it.<\/p>\n<p>To do it in Powershell run the commands below.<br \/>\nDon&#8217;t forget to update the path, server instance and file names to match yours.<\/p>\n<blockquote><p>\u25a1 Import-Module &#8220;C:\\Program Files\\Microsoft Dynamics 365 Business Central\\130\\Service\\NavAdminTool.ps1&#8221; \u2013force<\/p>\n<p>\u25a1 Publish-NAVApp -ServerInstance W1_NAVBC_CU5 -Path &#8220;C:\\&#8230;\\AL\\DataMigrationArticleUpgradeCodeunit\\Default publisher_DataMigrationArticleUpgradeCodeunit_1.0.0.0.app&#8221; -SkipVerification<\/p>\n<p>\u25a1 Sync-NAVApp -ServerInstance W1_NAVBC_CU5 -Name DataMigrationArticleUpgradeCodeunit<\/p>\n<p>\u25a1 Install-NAVApp -ServerInstance W1_NAVBC_CU5 -Name DataMigrationArticleUpgradeCodeunit<\/p><\/blockquote>\n<ol>\n<li>Next, uninstall the extension and publish it a higher version extension;<\/li>\n<\/ol>\n<ul>\n<li><strong>NOTE: This step is very important<\/strong>. BC will only do the data upgrade when you install a higher version of the upgrade extension. So at this moment update the extension version to a higher version, create a new package and publish the new version.*<\/li>\n<\/ul>\n<blockquote><p>\u25a1 Uninstall-NAVApp -ServerInstance W1_NAVBC_CU5 -Name DataMigrationArticleUpgradeCodeunit<\/p>\n<p>\u25a1 Publish-NAVApp -ServerInstance W1_NAVBC_CU5 -Path &#8220;C:\\&#8230;\\AL\\DataMigrationArticleUpgradeCodeunit\\Default publisher_DataMigrationArticleUpgradeCodeunit_2.0.0.0.app&#8221; -SkipVerification<\/p><\/blockquote>\n<p><strong>NOTE<\/strong>: Please note that I\u2019ve just published the new extension version using PowershelI, i didn\u2019t install it. I wasn&#8217;t able to do the data upgrade using Powershell so please do the following: after publishing the new extension version, open <strong>Extensions Management<\/strong> menu in RTC and install the new extension version there.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-715\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-40.jpg\" width=\"737\" height=\"598\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-40.jpg 737w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-40-300x243.jpg 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>At this moment the upgrade codeunit is executed and data is migrated;<\/p>\n<ol>\n<li>To check if data was migrated you can use a SQL query:<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-714\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-41.jpg\" width=\"1221\" height=\"319\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-41.jpg 1221w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-41-300x78.jpg 300w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-41-768x201.jpg 768w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2019\/06\/image-41-1024x268.jpg 1024w\" sizes=\"auto, (max-width: 1221px) 100vw, 1221px\" \/><\/p>\n<p>Et voil\u00e1, the data is migrated \ud83d\ude09<\/p>\n<ol>\n<li>You can now uninstall and unpublish the data upgrade extension and delete tables 70000 and 70001 in C\/SIDE.<\/li>\n<\/ol>\n<p>Feel free to leave your comments or ask me questions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last weeks I&#8217;ve read a few posts about C\/SIDE to AL Data Migration and as far as I understand people are struggling to have data migrated from C \/SIDE to AL tables. Data upgrade codeunits to the rescue. They exist in C\/AL and exists in AL as well so you should use and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":138,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[4],"tags":[58,59,6],"class_list":{"0":"post-723","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-dynamics365bc","8":"tag-al","9":"tag-businesscentral","10":"tag-dynamicsnav-2","12":"post-with-thumbnail","13":"post-with-thumbnail-icon"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C\/SIDE to AL Table Data Migration - Ricardo Paiva Moinhos<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C\/SIDE to AL Table Data Migration - Ricardo Paiva Moinhos\" \/>\n<meta property=\"og:description\" content=\"In the last weeks I&#8217;ve read a few posts about C\/SIDE to AL Data Migration and as far as I understand people are struggling to have data migrated from C \/SIDE to AL tables. Data upgrade codeunits to the rescue. They exist in C\/AL and exists in AL as well so you should use and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/\" \/>\n<meta property=\"og:site_name\" content=\"Ricardo Paiva Moinhos\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-21T21:13:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-29T09:01:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2014\/06\/PT_c_Dyn-NAV-2013.png\" \/>\n\t<meta property=\"og:image:width\" content=\"375\" \/>\n\t<meta property=\"og:image:height\" content=\"375\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ricardo Paiva Moinhos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ricardo Paiva Moinhos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/\"},\"author\":{\"name\":\"Ricardo Paiva Moinhos\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#\\\/schema\\\/person\\\/16dcfdd54ec1c46bd1941659739de4cc\"},\"headline\":\"C\\\/SIDE to AL Table Data Migration\",\"datePublished\":\"2019-06-21T21:13:10+00:00\",\"dateModified\":\"2021-09-29T09:01:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/\"},\"wordCount\":1242,\"commentCount\":23,\"image\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/PT_c_Dyn-NAV-2013.png\",\"keywords\":[\"\",\"\",\"dynamicsnav\"],\"articleSection\":[\"Dynamics NAV\\\/365 BC\"],\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/\",\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/\",\"name\":\"C\\\/SIDE to AL Table Data Migration - Ricardo Paiva Moinhos\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/PT_c_Dyn-NAV-2013.png\",\"datePublished\":\"2019-06-21T21:13:10+00:00\",\"dateModified\":\"2021-09-29T09:01:04+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#\\\/schema\\\/person\\\/16dcfdd54ec1c46bd1941659739de4cc\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/PT_c_Dyn-NAV-2013.png\",\"contentUrl\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/PT_c_Dyn-NAV-2013.png\",\"width\":375,\"height\":375},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/c-side-to-al-table-data-migration\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ricardomoinhos.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C\\\/SIDE to AL Table Data Migration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#website\",\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/\",\"name\":\"Ricardo Paiva Moinhos\",\"description\":\"Welcome\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ricardomoinhos.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#\\\/schema\\\/person\\\/16dcfdd54ec1c46bd1941659739de4cc\",\"name\":\"Ricardo Paiva Moinhos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g\",\"caption\":\"Ricardo Paiva Moinhos\"},\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/pt\\\/author\\\/ricardopaiva\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C\/SIDE to AL Table Data Migration - Ricardo Paiva Moinhos","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/","og_locale":"pt_PT","og_type":"article","og_title":"C\/SIDE to AL Table Data Migration - Ricardo Paiva Moinhos","og_description":"In the last weeks I&#8217;ve read a few posts about C\/SIDE to AL Data Migration and as far as I understand people are struggling to have data migrated from C \/SIDE to AL tables. Data upgrade codeunits to the rescue. They exist in C\/AL and exists in AL as well so you should use and [&hellip;]","og_url":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/","og_site_name":"Ricardo Paiva Moinhos","article_published_time":"2019-06-21T21:13:10+00:00","article_modified_time":"2021-09-29T09:01:04+00:00","og_image":[{"width":375,"height":375,"url":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2014\/06\/PT_c_Dyn-NAV-2013.png","type":"image\/png"}],"author":"Ricardo Paiva Moinhos","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Ricardo Paiva Moinhos","Tempo estimado de leitura":"9 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#article","isPartOf":{"@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/"},"author":{"name":"Ricardo Paiva Moinhos","@id":"https:\/\/ricardomoinhos.com\/#\/schema\/person\/16dcfdd54ec1c46bd1941659739de4cc"},"headline":"C\/SIDE to AL Table Data Migration","datePublished":"2019-06-21T21:13:10+00:00","dateModified":"2021-09-29T09:01:04+00:00","mainEntityOfPage":{"@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/"},"wordCount":1242,"commentCount":23,"image":{"@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#primaryimage"},"thumbnailUrl":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2014\/06\/PT_c_Dyn-NAV-2013.png","keywords":["","","dynamicsnav"],"articleSection":["Dynamics NAV\/365 BC"],"inLanguage":"pt-PT","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/","url":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/","name":"C\/SIDE to AL Table Data Migration - Ricardo Paiva Moinhos","isPartOf":{"@id":"https:\/\/ricardomoinhos.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#primaryimage"},"image":{"@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#primaryimage"},"thumbnailUrl":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2014\/06\/PT_c_Dyn-NAV-2013.png","datePublished":"2019-06-21T21:13:10+00:00","dateModified":"2021-09-29T09:01:04+00:00","author":{"@id":"https:\/\/ricardomoinhos.com\/#\/schema\/person\/16dcfdd54ec1c46bd1941659739de4cc"},"breadcrumb":{"@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/"]}]},{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#primaryimage","url":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2014\/06\/PT_c_Dyn-NAV-2013.png","contentUrl":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2014\/06\/PT_c_Dyn-NAV-2013.png","width":375,"height":375},{"@type":"BreadcrumbList","@id":"https:\/\/ricardomoinhos.com\/c-side-to-al-table-data-migration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ricardomoinhos.com\/"},{"@type":"ListItem","position":2,"name":"C\/SIDE to AL Table Data Migration"}]},{"@type":"WebSite","@id":"https:\/\/ricardomoinhos.com\/#website","url":"https:\/\/ricardomoinhos.com\/","name":"Ricardo Paiva Moinhos","description":"Welcome","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ricardomoinhos.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-PT"},{"@type":"Person","@id":"https:\/\/ricardomoinhos.com\/#\/schema\/person\/16dcfdd54ec1c46bd1941659739de4cc","name":"Ricardo Paiva Moinhos","image":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/secure.gravatar.com\/avatar\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g","caption":"Ricardo Paiva Moinhos"},"url":"https:\/\/ricardomoinhos.com\/pt\/author\/ricardopaiva\/"}]}},"jetpack_featured_media_url":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2014\/06\/PT_c_Dyn-NAV-2013.png","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts\/723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/comments?post=723"}],"version-history":[{"count":12,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts\/723\/revisions"}],"predecessor-version":[{"id":3837,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts\/723\/revisions\/3837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/media\/138"}],"wp:attachment":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/media?parent=723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/categories?post=723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/tags?post=723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}