{"title":"Moving Tables and Fields to Extensions Up the Dependency Graph","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-migrate-table-fields-up/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-migrate-table-fields-up, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-migrate-table-fields-up","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Explains how to move tables and fields from an extension to another extension that is up the dependency graph","date":"2021-04-01","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Moving Tables and Fields to Extensions Up the Dependency Graph","slug":"moving-tables-and-fields-to-extensions-up-the-dependency-graph","at":0,"chars":8206},{"level":2,"title":"Overview","slug":"overview","at":461,"chars":1498},{"level":2,"title":"Prerequisite","slug":"prerequisite","at":1959,"chars":209},{"level":2,"title":"Create transition extension (Ext Z v1)","slug":"create-transition-extension-ext-z-v1","at":2168,"chars":741},{"level":2,"title":"Create empty version of releasing extension (Ext X v2)","slug":"create-empty-version-of-releasing-extension-ext-x-v2","at":2909,"chars":727},{"level":2,"title":"Create final version of releasing extension (Ext X v3)","slug":"create-final-version-of-releasing-extension-ext-x-v3","at":3636,"chars":829},{"level":2,"title":"Create receiving extension (Ext Y v1)","slug":"create-receiving-extension-ext-y-v1","at":4465,"chars":1185},{"level":2,"title":"Create new empty version of transition extension (Ext Z v2)","slug":"create-new-empty-version-of-transition-extension-ext-z-v2","at":5650,"chars":756},{"level":2,"title":"Deploy the extensions","slug":"deploy-the-extensions","at":6406,"chars":1511},{"level":2,"title":"Related information","slug":"related-information","at":7917,"chars":289}],"text":"# Moving Tables and Fields to Extensions Up the Dependency Graph\nThis article explains how to move tables and fields from an extension to another extension that is up the dependency graph.\n> TIP\n> For more information about the general concepts for moving tables and fields between extensions, see Migrating Tables and Fields Between Extensions<devenv-migrate-table-fields>. This article explains the difference between moving up and down the dependency graph.\n## Overview\nThe steps are based on the example illustrated in the following figure. Although your scenario is different, the concept and process are much the same.\n![Data migration.]\nIn the example, TableB and Field C-2 are customizations. You'll move these elements from the original extension (Ext X) up to a new extension (Ext Y). This new extension will have a dependency on the original extension. You'll keep TableA and TableC in the original extension.\nTo accommodate data migration, you'll have to create an extension that is only used for deployment. This extension is Ext Z in the figure. There are two stages of deployment:\n![Data migration Up.]\n In the first stage, Ext Z temporarily takes ownership of tables and fields from Ext X.\n In the second stage, Ext Z releases ownership to extensions Ext X and Ext Y. You uninstall and unpublish transition extension Ext Z when you finish deployment.\nThis process is a two-step process because we only support moving down the dependency graph. So instead, the concept is to first move the tables' ownership to an extension above the receiving extensions in the dependency graph. Then, the extensions are moved down. This concept essentially turns the process into a two-step, move-down process.\nExt Z is used just as a temporary extension for moving ownership. So, it only includes schema objects. As a result, customers can't run on the tenant until both steps have been done.\n> NOTE\n> You can only use this process for on-premise solutions.\n## Prerequisite\nIf you're moving enum type<devenv-extensible-enums> fields, then your solution must be running on Business Central 2020 release wave 1, version 16.5 or later. See ../upgrade/known-issues#enum.\n## Create transition extension (Ext Z v1)\nThe transition extension will contain replicas of all table object definitions in the releasing extension, except logic code. In the illustration, these objects include TableA, TableB, and TableC and current their field definitions. The transition extension is Ext Z.\n1. Create an AL project for the transition extension.\n2. Add a table object that exactly matches the table object definitions for TableA, TableB, and TableC in the releasing extension.\n3. Compile the extension package.\n3. Make a note of the ID of the new extension. You'll use this ID in the next task.\n For purposes of the example, the ID is `00001111-aaaa-2222-bbbb-3333cccc4444`. The value for your extension will be different.\n## Create empty version of releasing extension (Ext X v2)\nIn this step, you create a new version of the releasing extension that doesn't contain any objects. It only contains a migration.json file that points to Ext Z.\n1. In the releasing extension AL project, add a migration.json file that points to the ID of the transition extension Ext Z.\n ```json\n {\n \"apprules\": [\n     {\n         \"id\": \"00001111-aaaa-2222-bbbb-3333cccc4444\"\n     }\n ]\n }\n ```\n See devenv-migration-json-file.\n2. Delete all objects from the extension. The objects include TableA, TableB, and TableC.\n3. In the app.json file, increase the version value. Ensure that you've included `\"target\": \"OnPrem\"`.\n4. Compile a new version of the extension package.\n## Create final version of releasing extension (Ext X v3)\nIn this step, you create another version of the releasing extension Ext X. This version will contain the objects and code that you want to finally publish.\n1. Create an AL project for Ext X.\n2. Add a table definition and code for TableA that exactly matches the definition in the original releasing extension.\n3. Add a table object for TableC and field definition for C-1 that matches the definitions in the original TableC object of the releasing extension.\n4. In the app.json file, increase the version value.\n5. Compile the extension package.\n6. Make a note of the ID and version of the extension. You'll use these values in the next task.\n For purposes of the example, the ID is `66667777-aaaa-8888-bbbb-9999cccc0000`. The value for your extension will be different.\n## Create receiving extension (Ext Y v1)\nYou now create a new extension that contains the customization you want to move from the releasing. In this example, the customizations include TableB and a TableExtC.\n1. Create an AL project for Ext Y.\n2. In the app.json file, set up a dependency on the third version of releasing extension Ext X v3 .\n For example:\n ```json\n   \"dependencies\": [{\"id\": \"66667777-aaaa-8888-bbbb-9999cccc0000\", \"name\": \"releaseextension\", \"publisher\": \"Default publisher\", \"version\": \"1.0.0.3\"}],\n ```\n The values for each parameter are for illustration purposes only. The values for your extension will be different.\n3. Add a table definition and code for TableB that exactly matches the definition in the original releasing extension.\n4. Add a table extension object called TableExtC. Then, add a field definition for field C-2 that matches its definition in the original TableC object of the releasing extension.\n5. Compile the extension package.\n6. Make a note of the ID of the new extension. You'll use this ID in the next task.\n For purposes of the example, the ID is `44445555-eeee-6666-ffff-7777aaaa8888`. The value for your extension will be different.\n## Create new empty version of transition extension (Ext Z v2)\nIn this step, you create a new version of Ext Z that only contains a migration.json file. This migration.json file points the IDS of Ext X and Ext Y. The file is used to release ownership.\n1. In the extension AL project, add a migration.json file that points to the IDs of the releasing extension Ext X and receiving extension Ext Y.\n ```json\n {\n \"apprules\": [\n     {\n         \"id\": \"66667777-aaaa-8888-bbbb-9999cccc0000\"\n     }\n     {\n         \"id\": \"44445555-eeee-6666-ffff-7777aaaa8888\"\n     }\n ]\n }\n ```\n See devenv-migration-json-file.\n2. Delete the object definitions for TableA, TableB, and TableC.\n3. In the app.json file, increase the version value.\n4. Compile the extension package.\n## Deploy the extensions\n1. Uninstall the current version of the releasing extension Ext X.\n2. Complete the following steps for the first stage of deployment:\n 1. Publish the transition extension Ext Z and empty version of Ext X v2.\n 2. Synchronize the transition extension Ext Z.\n  This step creates empty database tables TableA, TableB, and TableC that are owned by Ext Z.\n> IMPORTANT\n> Extensions receiving table objects must be synced first. Extension releasing/giving away table objects must be synced last.\n3. Synchronize the releasing extension Ext X v2.\n This step will read the migration.json of the extension. Then transfer ownership of the original tables TableA, TableB, and TableC to Ext Z.\n3. Complete the following steps for the second stage of deployment:\n 1. Publish the next version for Ext Z v2 and Ext X v3, and the first version of Ext Y.\n 2. Synchronize the extensions in the following order: Ext X v3, Ext Y v1, and Ext Z v2.\n  Synchronize Ext Z v2 last. When you synchronize Ext Z v2, ownership of the tables is transferred from Ext Z to Ext X and Ext Y.\n4. Run Start-NAVAppDataUpgrade cmdlet<https://learn.microsoft.com/powershell/module/microsoft.dynamics.nav.apps.management/start-navappdataupgrade> on the new releasing extension versionExt X v3.\n This step basically installs the new extension version. You run a data upgrade because an earlier version has been installed and is still published.\n5. Install the new receiving extension Ext Y v1.\n6. Unpublish both versions of Ext Z.\n## Related information\nMigrating Tables and Fields Between Extensions<devenv-migrate-table-fields>\nMoving Tables and Fields to Extension Down the Dependency Graph<devenv-migrate-table-fields-down>\ndevenv-upgrading-extensions\ndevenv-how-publish-and-install-an-extension-v2\ndevenv-json-files"}