Upgrade to 2013R2 - The field No. with ID 1 in the table...

ryancairnsryancairns Member Posts: 40
edited 2014-11-14 in NAV Three Tier
Hi - I am trying to upgrade a database from version 5 to 2013 R2.

I am at the step when I import the customised objects into the NAV 2013 R2 database. My service is running and I have ran the Sync-NAVTenant command.

Now when I import my objects any object that is modified/customised gives this error:

Microsoft Dynamics NAV Development Environment
The field No. with ID 1 in the table Customer cannot be deleted or changed because the field contains data in the XYZ database of the ABC company.
OK

Obviously in the new Customer table I am trying to bring in Field 1 and all the other standard fields exist. What is going on? Anyone any ideas?

Thanks

Comments

  • vremeni4vremeni4 Member Posts: 323
    Hi,

    I think the process is that you have to upgrade from NAV 5 to NAV2009 first after you can upgrade to NAV 2013 R2.
    For more details see http://msdn.microsoft.com/en-us/library/dn271649%28v=nav.71%29.aspx.

    The error message that you got is very common during upgrades. It happens when the table structure changes from one version to another.
    For example in NAV 5 the table customer has a field "Commercial port No.", in NAV 2013 this filed does not exist.
    Now when you import objects from NAV 2013 R2 it will try to delete this field, but it will identify that this field contains data hence it will stop and report this error message.

    The way to resolve this problem is to create a dataport and export these values in a file or copy them in another table. After that delete all values in this field.
    Now when you import objects system will try to delete it but at the same time it will see there is no data in this field so it will be happy and it will delete the field. In other words you will be able to import the object.

    I hope this helps.
    Thanks.
  • DoomhammerDoomhammer Member Posts: 211
    Hi, I will recycle this topic :)

    I am upgrading database from NAV 2009 R2 to NAV 2013 R2. NAV 2013 is build 7.1.37799.0.

    I merged objects, prepared 2009 database, executed upgrade step 1, opened database with 2013 client, attached service tier to it and now, I am importing merged objects...
    I have problem with importing of table 36 - there is field 80003 (our custom modification). this field exists in 2009 database and in 2013 merged objects too. please see screenshots of dev env...
    old 2009 table structure and field properties:
    2009i5sha.jpg

    and new merged table in 2013
    2013j3sm0.jpg

    I think, both fields are the same (I copied field from 2009 to 2013), but when I am importing merged table to database, which should be converted, I am getting error message similar to message in original post.

    I have trouble with 2 tables - 36 and 38; other merged tables were imported without problems.

    please, can you help me, where can be problem and how to correct it?
    Martin Bokůvka, AxiomProvis
  • TonyDuarteTonyDuarte Member Posts: 92
    The visible diference seems to be only the CaptionML for that field...

    If I'm not wrong that message show up when you try to edit a field and you have already data in the table.
  • crgarciacrgarcia Member Posts: 7
    What about the key? did it change?

    Carlos.
  • DoomhammerDoomhammer Member Posts: 211
    @cgarcia - nope, keys are not changed

    @Tony - there are added fields on other tables, which contain data, and they were imported without problems. only two tables cannot be imported.
    Martin Bokůvka, AxiomProvis
  • crgarciacrgarcia Member Posts: 7
    Can you export the 2009 R2 table as TXT and attach it here? I will try to reproduce the issue.

    Carlos.
  • DoomhammerDoomhammer Member Posts: 211
    thank you for help, see files here: https://drive.google.com/folderview?id= ... sp=sharing
    Martin Bokůvka, AxiomProvis
  • thegunzothegunzo Member Posts: 274
    I offer a tool to help with the comparison between versions and it even writes the upgrade code for you.

    http://objects4nav.com/upgrade-code-generation-tool-for-nav-2013/

    and

    http://objects4nav.com/upgrade-code-generation-tool-for-nav-2015/

    This can save a lot of time.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • mdPartnerNLmdPartnerNL Member Posts: 802
    thegunzo wrote:
    I offer a tool to help with the comparison between versions and it even writes the upgrade code for you.

    http://objects4nav.com/upgrade-code-generation-tool-for-nav-2013/

    and

    http://objects4nav.com/upgrade-code-generation-tool-for-nav-2015/

    This can save a lot of time.

    Have read your blog about this and hope I get what it is doing:
    All fields which are not in 2015 are transferred to a temp table? and then restored later in 2015?
  • DoomhammerDoomhammer Member Posts: 211
    thank you Gunnar, I will ask my boss if we will buy it, your tool looks very useful.
    Martin Bokůvka, AxiomProvis
  • thegunzothegunzo Member Posts: 274
    The tool will build all the temporary tables and the code to move/copy the fields to that table. If a field does not exist in the destination version it will be cleared with this code.

    This is step 1.

    Step 2 is always more complex, but still, you will get a lot of code for that step also. If for example a field type is changing from text to code or you want to move the field to a new number then all the code will be created for you.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • mdPartnerNLmdPartnerNL Member Posts: 802
    Step 2 is indead nice :)

    But say for example that I have only 4 customer fields in table 21, 50000,50001, etc

    1. Those fields will be copied to a temp table
    2. then you can follow the NAV upgrade steps (compiling, etc.)
    3. then these fields are recreated and the data moved back?

    if that's correct ok, if not then please use my example to explain the steps?
  • thegunzothegunzo Member Posts: 274
    Hi

    Fields that are identical between the old and the new version are not moved at all.
    If you have custom fields in table 21 in the old version and not in the new then the tool vill show you and you can decide to copy them to a temporary table, move the whole table to a temporary table or force the change = delete the data.

    The tool will create just the upgrade codeunit and is not intended to merge the code modifications to the new version. We have the new NAV modeling powershell tools and mergetool.com for that.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • mdPartnerNLmdPartnerNL Member Posts: 802
    So in the upgrade steps you can import the new 2013R2 table objects into a customer db?
  • thegunzothegunzo Member Posts: 274
    Look at these links

    http://www.dynamics.is/?p=2076

    http://www.dynamics.is/?p=1945

    You export all tables from the object designer as a text both from the old version and from the new version. You also need to have the CRONUS version tables imported the same way.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • mdPartnerNLmdPartnerNL Member Posts: 802
    Yes, I agree with you that your solution has made your life easier :)

    But im trying to understand at which step you needed it (during the upgrade).

    I think its the part in where you need to import 2013 table objects?
  • thegunzothegunzo Member Posts: 274
    All right.

    Microsoft delivers a upgrade tool. That tool will do things in two steps. Step 1 prepares the data in the old version so that the new version objects can be imported into the database without a data conflict. If you have added any fields to your database as a part of a customization you will also need to customize the upgrade tool that you get from Microsoft.

    By importing the table definitions for the old version and for the new version into my tool you can compare the two versions to find out what has been customized what what customization needs to be done to the standard upgrade tool. This is where my tool will build all the needed temporary tables and code to complete Step 1 without any extra manual work.

    In Step 2 the data in the temporary tables is applied to the new database structure. My tool can also give you a good suggestion on what you need to do in this step with your customized objects.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
Sign In or Register to comment.