# Migration

When updating from older versions (pre NavigaID) you might need to migrate the old lists/packages you currently have. This due to lists now supporting other types (lists/packages) within lists.

We also have a requirement on NavigaID data in the document to know who created it and which org/unit it belongs to.

## Item type

With the functionality to allow multiple types in lists all items need a type attribute in order to determine which content type it is. In the example below we have an old list without types and below that a migrated one which specifies one of the types \[Article, Package, List]

```markup
<list>
  <name>Example list</name>
  <description/>
  <type>list</type>
  <products>
    <product/>
  </products>
  <items limit="30">
    <item uuid="73890a03-48bb-4227-96d7-24aec558640f">
    <item uuid="9bad1876-7b6a-474b-85d7-6996913bdd48"/>
    <item uuid="7f697f6d-06dd-44db-b35e-9f7e114fa054"/>
    <item uuid="291bc370-a696-43ce-82a3-5fcde862a9f9"/>
    <item uuid="75ae8c28-1eac-4a4f-8681-108304a9a9a4"/>
  </items>
</list>
```

```markup
<list>
  <name>Example list</name>
  <description/>
  <type>list</type>
  <products>
    <product/>
  </products>
  <items limit="30">
    <item uuid="73890a03-48bb-4227-96d7-24aec558640f" type="Article"/>
    <item uuid="9bad1876-7b6a-474b-85d7-6996913bdd48" type="Package"/>
    <item uuid="7f697f6d-06dd-44db-b35e-9f7e114fa054" type="Article"/>
    <item uuid="291bc370-a696-43ce-82a3-5fcde862a9f9" type="List"/>
    <item uuid="75ae8c28-1eac-4a4f-8681-108304a9a9a4" type="Article"/>
  </items>
</list>
```

## NavigaID data

In order to be able to display the lists and packages in an NavigaID enabled environment they need to have the required data in the document itself. Below is an example of the data that needs to be added with units/orgs and how it looks in the full example

```markup
<itemMeta>
    <links xmlns="http://www.infomaker.se/newsml/1.0">
      <link rel="affiliation" type="x-imid/organisation" uri="imid://organisation/imid-internal" title="imid-internal">
        <links>
          <link rel="affiliation" type="x-imid/unit" uri="imid://unit/imnews" title="imnews"/>
        </links>
      </link>
    </links>
  </itemMeta>
```

#### List

```markup
<list>
    <name>Example list</name>
    <description/>
    <type>list</type>
    <products>
        <product/>
    </products>
    <items limit="30">
        <item uuid="73890a03-48bb-4227-96d7-24aec558640f" type="Article"/>
        <item uuid="9bad1876-7b6a-474b-85d7-6996913bdd48" type="Package"/>
        <item uuid="7f697f6d-06dd-44db-b35e-9f7e114fa054" type="Article"/>
        <item uuid="291bc370-a696-43ce-82a3-5fcde862a9f9" type="List"/>
        <item uuid="75ae8c28-1eac-4a4f-8681-108304a9a9a4" type="Article"/>
    </items>
    <itemMeta>
        <links xmlns="http://www.infomaker.se/newsml/1.0">
            <link rel="creator" type="x-imid/user" uri="imid://user/sub/znY7U3CO134n26zv9gb44_jCzSp">
                <links>
                    <link rel="affiliation" type="x-imid/organisation" uri="imid://organisation/company-x" title="Company X">
                        <links>
                            <link rel="affiliation" type="x-imid/unit" uri="imid://unit/newspaper-z" title="Newspaper Z"/>
                        </links>
                    </link>
                </links>
            </link>

            <link rel="updater" type="x-imid/user" uri="imid://user/sub/znY7U3CO134n26zv9gb44_jCzSp">
                <links>
                    <link rel="affiliation" type="x-imid/organisation" uri="imid://organisation/company-x" title="Company X">
                        <links>
                            <link rel="affiliation" type="x-imid/unit" uri="imid://unit/newspaper-z" title="Newspaper Z"/>
                        </links>
                    </link>
                </links>
            </link>
        </links>
    </itemMeta>
</list>
```

#### Package

```markup
<package published="false">
    <cover uuid="1171e4d7-f8e9-49b8-8df4-668dcf4050da"/>
    <name>Example package</name>
    <type>Daily</type>
    <products>
        <product/>
    </products>
    <category/>
    <pubStart>2019-08-08T07:40:23.000Z</pubStart>
    <pubStop/>
    <pubStatus>draft</pubStatus>
    <itemList uuid="5d940e6a-653e-4fa9-8947-abeae89f721d"/>
    <itemMeta>
        <links xmlns="http://www.infomaker.se/newsml/1.0">
            <link rel="creator" type="x-imid/user" uri="imid://user/sub/znY7U3CO134n26zv9gb44_jCzSp">
                <links>
                    <link rel="affiliation" type="x-imid/organisation" uri="imid://organisation/company-x" title="Company X">
                        <links>
                            <link rel="affiliation" type="x-imid/unit" uri="imid://unit/newspaper-z" title="Newspaper Z"/>
                        </links>
                    </link>
                </links>
            </link>

            <link rel="updater" type="x-imid/user" uri="imid://user/sub/znY7U3CO134n26zv9gb44_jCzSp">
                <links>
                    <link rel="affiliation" type="x-imid/organisation" uri="imid://organisation/company-x" title="Company X">
                        <links>
                            <link rel="affiliation" type="x-imid/unit" uri="imid://unit/newspaper-z" title="Newspaper Z"/>
                        </links>
                    </link>
                </links>
            </link>
        </links>
    </itemMeta>
</package>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.navigaglobal.com/oc-list/master-2/admin/migration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
