Package Export & Import

I am using the PackageImportExport utility SP14 (build 7022). Can you anyone advise the 2 field on the Export screen:
  • Level: it defaults to 1
  • Export Referenced Items
I tried to export the Form and ItemType for ECR. and during import, I got the error below (tried with or without Export Referenced Items  option ticked): Grid Event Already exists. Violation of Primary Key constraint.   And there is no additional info provided.  I haven't had much success with the import, only worked very few items. I don't want to back up the whole database and restore it to another environment, which is not ideal when promoting changes to Prod! Any ideas?  
  • If you want to export elements, that are related to existing Aras Items (like ECR), try the following settings: Export: "Export Referenced Items" - do not tick "References to Unknow Packages" -> Tick 'Don´t Remove' This way you don´t export the original ECR, but you will keep the references to the ECR. Important: Also ways use Super User for export/import. Sometimes regular Admin accounts may work, but most of the time they don´t have the necesary permisseion level to handle everything.
  • Thanks. So it's better to export the packages separately, one for exiting itemtypes, and do another export for new itemtypes. But once the new itemtypes imported, should be able to export any future updates as they are all existing itemtypes? Anyway i tried above, and getting a different error:  Aras.Server.Core.ItemNotFoundException. And the import log doesn't have much details on which item failed to import. Any ideas?
  • It´s not always necessary to split the packages. But sometimes you have to do it, to ensure that new content is available before you link it to existing ItemTypes. (@ Aras: Please correct me if I am wrong!) You can increase the log level for getting more detailed information about your Exception. Or just watch the bottom left corner during import. Maybe you can see, which package or file throws the error.
  • It looks like Import cant replace the ItemType with new defintions or update a List. If I use the merge option, it simply merges the data from exported package, or merge the form rather than replacing it. If I use the Ignore option, it will generate a primary key violation error. Can anyone advise if they can successfully import to update ItemType, or Form, or List?
  • Hi fdxu168, When you say you want to "replace" the ItemType, are you saying you want to remove an existing ItemType and create a brand new ItemType to replace it (with a new id)? For example, say you decide to build your own Part ItemType instead of using the out-of-the-box Part ItemType. So you delete the Part ItemType in your source database, create a new Part ItemType, add it to a package, export it, and try to import it to a clean Aras database. This won't work because the Part ItemType you're trying to import has a different id/keyed_name pair than the Part ItemType already in the target database. If you need to override a default ItemType/List/Form/etc. you should do so by modifying the existing item or creating a separate item in parallel rather than replacing it with your own brand new item. For the scenario I described above, it would be better to modify the OOTB Part ItemType to fit your needs or create a new ItemType like "my_Part". Either approach should avoid/reduce import errors and make the upgrade process smoother and the "rip and replace" approach. If you absolutely have to delete and replace an item, you should delete the item from the target database before running your import. By default, import packages are additive - they will only add or update items, not delete them. One last piece of import/export advice. Always backup your target database before executing an import. That gives you a copy to fall back on if the import breaks something or you need to diff the configuration before/after the import. Hope this helps. Eli
    Eli Donahue Aras Labs Software Engineer
  • Hi Eli, I want to update an item, e.g. a list or a form. If I use the merge option during import, the list is not replaced, instead it has old values which was dropped from the list to be imported. And similarly for form, fields are merged instead of being replaced by the form exported. So far I have not been able to import successfully without errors, especially when an item type has relationships. Can you advise the exact steps & options required to do a successful export and import?
  • Hi fxdu168, The import/export tools do not delete items from the target database (by default). For example, say you have a list of countries with 3 values:
    1. China
    2. US
    3. Germany
    Then you modify the list to remove Germany and update "US" to "United States". Your exported list will look like this:
    1. China
    2. United States
    When you import that list into a target database with the previous version of the list, the import tool will add any items that don't exist in the target database (none in this example) and update any items that have the same id but different property values (US -> United States). The import tool does not delete items that exist in the target database but not the import package, otherwise it would be very easy to mess up your environment. If you need to delete items from the target database, you have a few options:
    1. Manually delete the items. This isn't ideal because it's time consuming and easy to make a mistake.
    2. Create some AML you can run in Nash to delete the items. This is a little faster to run, but you still need to build the AML.
    3. Include delete statements in your import packages. This is also a manual process, but it allows you to delete items during your import.
    For the example above, you would need to add a delete statement to remove the third entry from the list. Ex:
    <Item type="Value" id="{id of 'Germany' list value}" action="delete" />
    Eli
    Eli Donahue Aras Labs Software Engineer
  • Hi , if supposed to export a Custom ECN item type and it's forms and lifecycle, and methos , how is that possible?
  • Hi selvlennox, If you want to export a completely custom itemtype, you can just add the itemtype and any related items (like forms and methods) to a custom package. Eli
    Eli Donahue Aras Labs Lead Engineer