NAV2018 CU 5 Extensions V2 and schema breaking changes

Hello All,

Is there any way to upgrade an extension, with “schema breaking Changes” (PK changed for one table) and restore the user data for the extension tables?

I have searched and found some threads for this issue, but I am still a bit confused. Some threads states that this is not possible and yet some suggests to solve this using an upgrade codeunit. I have made a number of tries, but have not yet succeeded. As far as I understand the procedure is to (uninstall the old version), publish, sync and DataUpgrade the new extension version, while the DataUpgrade automatically should detect and run the upgrade codeunit.

When performing this procedure the Sync fails with an error message related to the schema breaking change and the only remaining option seems to be a sync in “-Clean” mode. The following DataUpgrade command then fails with an error message that no prior extension version can be found.

Thanks in advance

Örjan Brun, I have the same issue right now and if you find solution, please, inform.

I’m thinking to develop upgrade codeunit which update data… but I don’t now is it correct. The code like (example from MS page):

if NAVAPP.GETARCHIVERECORDREF(50000, ArchiveRecRef) then
IF ArchiveRecRef.FINDSET(FALSE) then
DestRec.INIT;
REPEAT
FldRef := ArchiveRecRef.FIELD(50000);
DestRec.Key := FldRef.VALUE;
FldRef := ArchiveRecRef.FIELD(50001);
DestRec.V1Field := FldRef.VALUE;
DestRec.V2Field := ‘NEW FIELD DEFAULT VALUE’;
DestRec.INSERT;
UNTIL ArchiveRecRef.NEXT = 0;

Again, if SOMEONE has information how to do it, please, inform.