How to Migrate Record Links Data When Upgrading from Dynamics NAV On-Prem to SaaS
If you are a Dynamics NAV user, you have likely noticed by now that Microsoft does not support record links migration when upgrading to Dynamics 365 Business Central SaaS.
That's because the links are related to user IDs, and some of those links may be unreachable depending on where linked files are stored in the client environment.
Using a configuration package to move the data over is not an option because you cannot select System Tables through it.
We recently completed a cloud migration for one of our clients and had to develop a custom process to migrate Record Links. We will be sharing our approach in this post. Some processes, such as filtering, may be specific to our client data. If you want to apply this to your environment, you might need to modify some parts based on your client's needs.
How to Run the Record Links Migration Process
There are two types of data stored in Record Link: Notes and Links.
Notes store text data - typically internal company notes - while Links store paths to client files, which may be located on your client's desktop, D: drive, a network drive, or somewhere else. In the case of our client, we handled migration for each of the two types of Record Links separately.
Let's take a look at each type.
Record Links Data from Dynamics NAV - Notes
We started by creating a custom table to store only Notes. This table is a copy of the stock Record Links table, along with a couple of new fields.
We created a processing report to import Notes from the stock Record Links table into the custom table, and then exported it back to the Record Link table after migration to the cloud. Note that filters in a report are specific to your data and you can select your own filters.
As you can see, the report request page has two checkboxes where you can select what part of the process to initiate.
The code below populates data into a custom Record Link table when you select the "Copy Record Links from NAV" checkbox.
The next piece of code exports data from the custom Record Link table into the stock Record Link table. You need to run this after you have migrated your data to the cloud. Make sure to follow your usual upgrade routine for custom tables, whether it is an upgrade codeunits or another process you are comfortable with.
Record Links Data from Dynamics NAV - Links
Now that we've gone through Notes, we can now analyze data migration for the Links.
It's good practice to store Links (i.e., any client files) in one location on a client VM, like a centralized file share for all users. In our situation, our client was following this best practice.
We converted linked documents into document attachments. Since Dynamics 365 Business Central 14 is a part of the upgrade path - and has Document Attachments logic available - our plan was to temporarily store client documents in a BLOB field on Record Link table. Then we copied those fields into the Document Attachments table during the Business Central 14 upgrade step.
We added three new fields to the Record Link table to help with record filtering and file storage. Note that moving the files into the new BLOB field will increase the database size. Our client had a lot of data and agreed to bring only files for the last five years since the database size was a concern going into cloud migration.
We created a codeunit to handle file conversion into BLOB and to help copy files to attachments during BC14 upgrade step.
In order for this to work, you need to run the CopyFileToBlob function on your client VM. Doing so will convert files to BLOBs and mark all the Record Link records for which files were successfully converted.
Below are the variables we used:
As you can see, we experienced some challenges getting access to files on the network drive and had to relocate those to the C: drive that Dynamics NAV could access successfully.
If your client has VM files all over the pace, and NAV cannot access those, the best approach to alleviate this would be to minimize the number of files you move to your SaaS. You will probably have to write more custom code that can handle a scenario like that.
The next step is to convert BLOB fields into Document Attachments during the BC14 upgrade by running the CopyBlobToAttachment function. (Remember to comment out CopyFileToBlob and uncomment CopyBlobToAttachment).
Below are the variables we used:
We encountered file name conflicts and simply renamed the files to have a '_2' at the end of the file name. That worked as planned and allowed us to create the file attachments successfully. After verifying the data, we deleted the custom fields from the Record Link table and continued with the upgrade process.
In summary, we had to be creative and adjust our plans a few times during the Record Links upgrade. The migration ended up working very well and our client received the files they needed to run their business processes.
Want to Learn More About How Stoneridge Can Help You?
As you can see in this blog post, we have an experienced team ready to assist you with this process, other processes related to upgrading, and a ton of additional software solution issues.
Please get in touch with us to learn more!
Under the terms of this license, you are authorized to share and redistribute the content across various mediums, subject to adherence to the specified conditions: you must provide proper attribution to Stoneridge as the original creator in a manner that does not imply their endorsement of your use, the material is to be utilized solely for non-commercial purposes, and alterations, modifications, or derivative works based on the original material are strictly prohibited.
Responsibility rests with the licensee to ensure that their use of the material does not violate any other rights.