Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Extension Data Migration

Posted on by 670
In the Data Migration tool, how does one ensure that extension data is included in the process?
 
Does the 'App ID' have to match at source and destination? For instance let's say you have an extension on the old system called SampleExt14 and a corresponding extension on the new system called SampleExt23. They are fundamentally the same extension but target different BC versions and therefore may contain differences in some codeunits. However, the table schemas & id's are the same. Their respective app.json files have different App ID's. Will that work in the data migration, or do they have to match?
  • Nick Webb Profile Picture
    Nick Webb 670 on at
    Extension Data Migration
    Firstly, thanks all for your responses. Very helpful.
     
    In response to:
     
    An extension on the old system called SampleExt14 and a corresponding extension on the new system called SampleExt23?
    • Why Extension name will be different. They Should be same. For Reference see Microsoft Base App Extension. From Business Central 15 to Latest Version of Business Central - App Id, App Name and Publisher is same. Only thing that changes is version which is incremented with every version (CU's Included). 

      For years I've had to maintain 2 versions of the code in a couple of my extensions, one for our internal Business Central which is version 14 on-prem and one for latest SaaS version. So I would initially develop against latest cloud sandbox and then wind back for the old version. So to clone the extension I performed these steps: (1) In VSCode -> AL:Go, specified a new folder path, specified the desired runtime, and then copied *.al from one folder to another. Worked fine, but the result is two extensions with different App ID's in their app.json's. Hasn't mattered until now when we're looking to migrate our internal BC from v14 to latest SaaS via the Migration tool. Turns out this is the wrong way to do it... Who knew? I'm completely self taught.
  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 17,965 Super User 2024 Season 2 on at
    Extension Data Migration
    Hi,
     
    Let's understand you question with set of questions. Hopefully you will be able to understand what you need to do.
     
    • Ensure that extension data is included in the process?
      • Every data is included in process. With Extensions model each app (Extension) have its own scope and you as partner or developer is only responsible for your app upgrade (if required).
    • Does the 'App ID' have to match at source and destination?
      • For Upgrade yes, APP ID Should be Same. Only then its considered as upgrade otherwise it's a new app all together. 
    • An extension on the old system called SampleExt14 and a corresponding extension on the new system called SampleExt23?
      • ​​​​​​​Why Extension name will be different. They Should be same. For Reference see Microsoft Base App Extension. From Business Central 15 to Latest Version of Business Central - App Id, App Name and Publisher is same. Only thing that changes is version which is incremented with every version (CU's Included).  
    • They are fundamentally the same extension but target different BC versions and therefore may contain differences in some codeunits.
      • ​​​​​​​From an upgrade perspective, until you are making changes to data schema (Tables and Table Extension) the data will be upgraded as is. If there is a change in table or Table schema (Destructive changes only) then you will require an upgrade logic.
    • How an upgrade executes?
      • ​​​​​​​Each app in its own scope have to write upgrade logic (if required). The way you do it is using codeunit of subtype upgrade in newer version. 
      • Codeunit of subtype upgrade, triggered automatically when you trigger upgrade PowerShell cmdlet (on-prem) or when you publish newer version of app in Cloud. 
    • How these codeunit trigger on-prem?
      • ​​​​​​​During upgrade after running Microsoft upgrade process for each app you run following cmdlets.
      • Publish-navapp (New version)
      • Sync-NavApp (New Version)
      • Start-NAVAppDataUpgrade (New Version) - This step looks for upgrade codeunit and if exist executed automatically. 
    • Why there are lot of steps in Microsoft upgrade article?
      • ​​​​​​​Microsoft is responsible to perform platform upgrade and application (extension) upgrades. Majority of steps are related to platform upgrade. For Application (Extension) upgrade you will have to follow three steps listed above.
    • Summary
      • If you app have no table / table extension (destructive changes) then go ahead and just follow three commands during upgrade process of your apps and your data will come as is.
      • If you have changes that you would like to move to other (new) tables then you will have to write upgrade logic to move/copy data.
    If you are refactoring your app like Merging two apps to one app or splitting one app to two apps (on-prem only) then follow steps as YUN ZHU posted.
     
    For reference you can watch this recording where I explain how you upgrade from AL to AL.  
     
    If you have further question, please feel free to ask.
     
    Regards,
    Saurav Dhyani
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,565 Super User 2024 Season 2 on at
    Extension Data Migration
    Hi, hope the following helps.
    Migrating Tables and Fields Between Extensions
     
     
    Thanks.
    ZHU
  • gdrenteria Profile Picture
    gdrenteria 12,167 Most Valuable Professional on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans