The following is a process to use the LCS Code Upgrade tool to import code from AX 4.0 or AX 2009 to D365.
Before you read any further, the key thing here is that you need access to an AX 2012 environment. You need to use the 2012 environment as a midpoint in the process because only 2012 a) is supported by LCS Code Upgrade tool and b) can import xpo code. If you don't have access to a 2012 environment, then the following probably won't be helpful to you.
So here's the process:
Prepare the AX 2012 environment
When you use the LCS Code Upgrade tool, you import zip file containing a modelstore. (not a model!). If you're like me, you're really only looking to move a subset of customizations...not every last object in your old AX. The solution here is to use a 'vanilla' 2012 instance.
There are multiple ways to do this, but I did it by Uninstalling all models except the core sys/syp layer stuff. LCS Code upgrade will see all the core AX code in your model store, but just ignore it because it's all standard.
WARNING: Before you uninstall models, make sure you a) have a way to get this code back, b) realize that any data tables defined by uninstalled models (or fields) will be lost. In my case, I'm using a development environment with no valuable data. I exported the model store (see procedure below) BEFORE uninstalling any models...and later I'll re-import that model store so I retain all my code.
In 2012 you can see the installed models in Tools, Model management, Installed models
Back up your 2012 code
If you're going to uninstall models from the 2012 environment, you probably want some way to get them all back later. To
Uninstall unwanted models
I uninstalled VAR/CUS/USR layer models and all 3rd party (ISV) code.
For example:
Now your Installed models should look something like this:
Create a new model in 2012
Create a model with the same name as the model that you intend to use in D365
To do this, in AX 2012: Tools, Modules, Create new model.
Export your code from 4.0 or 2009 in an xpo.
Import your XPO code into 2012
Making sure that you're working in your new model (see lower right of AX screen), import your xpo code from your original environment like you normally would. The infolog that you get here can be helpful in making sure that you got all the objects that are referenced in the code. If you missed something, just import it into 2012 - no big deal.
Export the model store
Back in Powershell or AXUtil, export your model store which will contain the sys/syp core code and whatever you imported from your xpo.
For example
The file that is created will be big - maybe 5GB - so make sure you have room on your drive. But it zips down quite a bit smaller - under 1GB. The zipped file is what you upload to LCS.
LCS Code Upgrade process
One note on what the video covers: Each time you do the Code Upgrade process, you'll see a new folder created under Releases in Azure Dev Ops (or VS Team Explorer, Source Control explorer). See the 8.1.136.24_U1...folders below. It was interesting that, while a new 8.1.136.24_U1...folder was created for each Code Upgrade, only a single AX2012 folder was created and it was just updated each time the Cost Upgrade was done.
At first I thought we'd want to use the 8.1.136.24_U1...folder (I'd seen that in doc/videos online), but there were a few issues with that. In my case the model was prepended by "ApplicationSuite." Also the 8.1.136.24_U1...folder was missing the XppMetadata folder. The AX2012 folder, however, had the correct model and included the XppMetadata folder. (Note that the AX2012 folder seems to be overwritten with each run of Code upgrade...so keep that in mind as you decide
when to do your merging as discussed below)
So, rather than mapping my VS workspace to one of the 8.1.136.24_U1...folders, I did two merges from the model (ie CompanyNameExtensions) and XppMetadata folders to the corresponding DEV branch locations. (Notes: In my case the descriptor file that I already had in my dev branch was more accurate, so I didn't merge that. Also, the Foundation and Update for Foundation folders in my image below can be ignored - they shouldn't be there. Also, you'll notice that I didn't do anything with the Projects folder because in my case the canned projects that are created by LCS Code upgrade were not helpful. But you could merge those from the 8.1.136.24_U1...folder to your DEV branch projects folder)
The merges create source-controlled, but not-checked-in objects in the DEV branch and from there you can use VS to build your model and resolve your errors.
Hope that helps! Have fun!