> ## Documentation Index
> Fetch the complete documentation index at: https://docs.junojourney.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Migrations

> Run one-off data migrations from Admin Settings — including the Block to Inline Comments migration with dry-run preview.

export const RelatedPages = ({pages = []}) => {
  if (pages.length === 0) return null;
  return <>
      <br />
      <strong>Related articles</strong>
      <CardGroup cols={2}>
        {pages.map(page => <Card title={page.title} href={page.href} key={page.href} />)}
      </CardGroup>
    </>;
};

export const RoleBadge = ({roles = []}) => {
  const colorMap = {
    Admin: "yellow",
    Manager: "blue",
    Learner: "green",
    "Co-editor": "purple"
  };
  return <>
      {roles.map(role => <span key={role}><Badge color={colorMap[role] || "gray"} size="sm" shape="pill">{role}</Badge>{" "}</span>)}
    </>;
};

<RoleBadge roles={["Admin"]} />

## Overview

The **Migrations** panel in **Admin → Settings** is where you run one-off data migrations against your tenant. Each migration includes a **Dry Run** mode so you can preview the impact before Juno writes any data.

<Note>
  Migrations require the **Admin** role. They run scoped to your current tenant — they never affect other organizations.
</Note>

***

## Migrate block comments to inline comments

Older content in Juno used **block-level comments** that attached to entire content blocks. Inline comments — the newer experience — attach to a specific element (a paragraph, an image, a list item) inside the editor and render as a colored highlight you select to open the thread.

This migration moves every legacy block comment in your tenant to the inline format, so reviewers and authors see all threads in the same place going forward.

### When to use it

Run this migration if you want to:

* Consolidate review activity into one comments experience after upgrading from block comments.
* See historical block comments inline next to the content they describe.
* Clean up content that mixes the two comment styles.

You only need to run it once per tenant. Re-running it is safe — already-migrated threads are skipped.

### Before you start

* Confirm you have the **Admin** role.
* Decide on a scope:
  * **Whole tenant** — leave both ID fields blank.
  * **Single learning unit** — provide a **Unit ID**.
  * **Single section** — provide a **Section ID**.
* Always **dry run first**. The report tells you exactly how many threads Juno would create and lists anything it would skip, so you can spot-check before committing.

### Run the migration

1. Go to **Admin → Settings → Migrations**.
2. Locate the **Migrate Block Comments to Inline Comments** card.
3. (Optional) Enter a **Section ID** or **Unit ID** to limit the scope.
4. Select **Dry Run** to preview the changes.
5. Review the report (see below).
6. When the dry-run numbers look right, select **Migrate Comments** to apply.

### Reading the report

Each run returns a report with the following counts:

| Field                                            | Meaning                                                                                                                                                                                                                                  |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Found**                                        | Block comments Juno discovered in scope.                                                                                                                                                                                                 |
| **Created** *(or **Would create** on a dry run)* | New inline threads Juno wrote.                                                                                                                                                                                                           |
| **Already migrated**                             | Block comments Juno migrated on a previous run and skipped this time.                                                                                                                                                                    |
| **Skipped**                                      | Block comments Juno did not migrate. Each entry shows the element type and the reason — for example, `empty_comments` (the block had no comment content) or `no_creator` (Juno could not resolve an author).                             |
| **Thread created but no visual mark**            | Juno created the inline thread but could not attach a highlight to a matching element in the editor — usually because someone deleted the element after writing the comment. You can still open the thread from the comments side panel. |
| **By type**                                      | Breakdown of created threads by element type (paragraph, heading, image, code block, and so on).                                                                                                                                         |
| **Duration**                                     | How long the run took.                                                                                                                                                                                                                   |
| **Errors**                                       | Any failures Juno encountered during the run.                                                                                                                                                                                            |

Migrated threads behave exactly like inline comments you create in the UI — you can reply to them, resolve them, and delete them the same way. Juno tags them internally so that, if needed, support can audit or roll back migrated threads without touching threads you create in the UI.

### Example: dry-run a single unit

To preview the migration for one learning unit before running it across the tenant:

```text Migrate Block Comments theme={null}
Section ID: (leave blank)
Unit ID:    65f0a1b2c3d4e5f6a7b8c9d0
Action:     Dry Run
```

The report shows what would happen for that unit only. If the numbers look correct, switch to **Migrate Comments** with the same Unit ID to apply the change, then re-run with both fields blank to migrate the rest of the tenant.

***

<RelatedPages
  pages={[
{ href: "/admin/customization", title: "Settings & Customization" },
{ href: "/collaboration/create-and-collaborate", title: "Create & Collaborate" },
{ href: "/admin/roles-and-security", title: "Roles & Security" },
]}
/>
