How a migration works

v0.0.3

A migration run moves a site's content in two steps, a dry run that writes nothing and an import that does, and remembers every item so that running again updates instead of duplicating. This page explains the run's life, what is remembered, and why a second run is safe. Read it when you wonder what a button will change.

What it moves and how it works, on one page: Mishka CMS Migration.

What a run is

A run is one move of one site's content. It holds the source (WordPress or WordPress export file), the host it reads from, how it connects, the choices you made and how far it got. It belongs to one site of your Mishka CMS installation. A site can take content from many sources, such as two WordPress blogs, and each run shows its own.

The life of a run

  1. Connected: the run checked the source and is saved. The Start the dry run button starts the first dry run at once.
  2. Dry run running, then Dry run ready: the job walked the whole source, recorded a plan for each item and saved a report. It wrote nothing in your site.
  3. Importing, then Imported: the import wrote each item through the CMS's own action, as the admin who pressed Import, and saved a report.
  4. Failed when the job stops. Cancelled when you end the run.

The dry run and the import are background jobs on the migration queue. A job tries up to three times. One run of a site works at a time, so a second request is refused until the first finishes. A job you cancel stops at its next page of the source. The run's log keeps one entry for each step, and the topbar bell tells you when a dry run or an import ends.

What is remembered

The extension remembers each item by site, host, kind and source id, so the same id on two hosts is two items. For each item it keeps what the last dry run would do with it, what the last import did, the record it became and your decisions. This is what the Items page lists.

Why running again is safe

Press Run again and a fresh dry run reads the source again on the same run and connection. The import that follows:

  • updates what the source changed since the last import,
  • keeps what you changed in the CMS: a record you edited, or deleted, or archived stays as you left it, and its item says so,
  • brings what you decided, left out or mapped since,
  • never overwrites a clash. The same address as a record that is not the item's fails the item with the CMS's reason, or waits for your decision.

A new run of the same host does the same, because the items are what make it so.

What a decision means

A decision belongs to the item, not to the run. It holds for every later dry run and import, and writes nothing by itself. The import writes it.

Secrets and files

The application password you type is sealed with the CMS's secret key and kept from the run's creation until you cancel it. A run that is done or failed keeps it, so it can run again. A run whose password can no longer be opened, because the key was rotated, fails, and you start a new run with the password typed again. The export file is kept in a folder the CMS does not serve, readable only by the CMS's own user, because it holds drafts, private posts and commenters' addresses. Cancelling the run deletes it.