You are viewing beta documentation for Navigation 4.x.
Migrations

Migrating from Navkit

If your Craft site runs Navkit (opens new window) (jainilnagar/navkit), Navigation can copy menus and node structure without modifying Navkit data — similar to Formie's plugin migrations (opens new window).

Prerequisites

  1. Install both Navkit and Navigation on the same Craft site.
  2. Back up your database and project config.
  3. Run the migration on staging first.

Control panel

  1. Go to Navigation → Settings.
  2. Under Migrations, choose Navkit.
  3. Select the menus to migrate (or choose All).
  4. Optionally enable Skip existing handles if you do not want to overwrite menus that already exist in Navigation.
  5. Click Migrate Menus and review the per-menu output log. Click Done when finished.

Console

# All Navkit menus
php craft navigation/migrate/navkit

# Specific handle(s)
php craft navigation/migrate/navkit --handle=mainMenu,footerMenu

# Skip menus whose handles already exist in Navigation
php craft navigation/migrate/navkit --skip-existing

What is migrated

NavkitNavigation
Menus and handlesMenu name, handle, site settings
Entry, category, asset, product linksMatching element-backed node types
URL linksCustom node type
Passive linksPassive node type
Nested structureParent/child tree preserved
Node CSS classes, target="_blank"classes, newWindow
rel attributecustomAttributes
Per-menu node custom fieldsNode field values on the primary site
Multi-site propagationPer-site menu settings

If an element-backed node no longer has a resolvable linked element, it is converted to a Custom URL node and a warning is logged.

Manual follow-up

Navkit featureNotes
Per-menu node field layoutsField values are copied when the same custom fields exist on the Navigation menu layout; add matching fields to the Navigation menu before migrating if needed
Menu field layoutsNavkit has no menu-level fields — not applicable
GraphQL / template clientsUpdate to Navigation's craft.navigation.render() or craft.navigation.nodes()

Handle collisions

When a Navigation menu with the same handle already exists, the migrator creates a new menu with a numeric suffix (for example mainMenu1).

Template mapping

{# Navkit #}
{{ craft.navkit.render('mainMenu') }}

{# Navigation #}
{{ craft.navigation.render('mainMenu') }}