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.exsand 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:
{:mishka_cms_migration, "~> 0.0.3"}mix deps.getRegister 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:
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:
config :mishka_cms, Oban,
queues: [migration: 1]Generate and run the migration for the runs, items and log tables:
mix ash.codegen add_cms_migration
mix ash.migrateSet 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:
| Permission | Opens |
|---|---|
admin:dashboard:migration | The Migration page and a run's Items page in the admin. |
admin:api:migration | The 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
- Sign in as that admin. The sidebar shows Migration under Plugins.
- Open it. You see the Sources cards, WordPress and WordPress export file, each with a New import button.
Next steps
- Move a WordPress site: start the first run.
- Permissions and plugin events: every permission an import needs.