Install the migration extension

v0.0.3

Mishka CMS Migration is an Elixir package. A project cloned from the Mishka CMS repository may already list it. This guide adds it to a host you built yourself, sets it up on a site and gives an admin access. You finish with a Migration entry in the admin sidebar.

Before you begin

  • A Mishka CMS host project and its mix.exs, config/config.exs and database.
  • Mishka Blog in the same host, if you want posts, categories, tags, authors and comments. Pages, media, settings, stylesheets and menus do not need it.
  • An account that can set up an extension on a site. See Install an extension.

Add the package

Add the package to deps in mix.exs and fetch it:

elixir
{:mishka_cms_migration, "~> 0.0.3"}
bash
mix deps.get

Register it in the host

In config/config.exs, add the Ash domain to the host's domains and the web module to the core's extensions. Keep the entries you already have:

elixir
config :mishka_cms,
  ash_domains: [MishkaCmsMigration, MishkaBlog, MishkaCmsCore.Runtime, MishkaCmsCore.Accounts]

config :mishka_cms_core,
  extensions: [MishkaCmsCoreWeb, MishkaBlogWeb, MishkaCmsMigrationWeb]

Give Oban a migration queue with one worker. The dry run and the import are jobs on it, and one run of a site works at a time:

elixir
config :mishka_cms, Oban,
  queues: [migration: 1]

Generate and run the migration for the runs, items and log tables:

bash
mix ash.codegen add_cms_migration
mix ash.migrate

Set it up on a site

Open the extension's setup from the CMS installer, as Install an extension shows. Setting up adds the two permission names the extension uses and nothing else: it ships no components, pages or snippets, and it has no tab in Settings. A site admin sets up their own site, and a master picks any site.

Give an admin access

Grant the admin who will run imports these permissions:

PermissionOpens
admin:dashboard:migrationThe Migration page and a run's Items page in the admin.
admin:api:migrationThe same runs and items over the admin API.

An import writes as the admin who pressed it, so that admin also needs the permission of each kind they bring. The table is in Permissions and plugin events. See also Give a teammate access.

Check that it works

  1. Sign in as that admin. The sidebar shows Migration under Plugins.
  2. Open it. You see the Sources cards, WordPress and WordPress export file, each with a New import button.

Next steps