Skip to content

Roll back an import

Undo a finished import from the Jobs tab. A dry rollback first counts what will change; then the importer deletes what the import created and gives back what it changed, but never overwrites an editor's later work.

Every real import keeps a journal: before it first writes to an entry, the importer stores what the entry held, or that it didn’t exist yet. A rollback walks that journal backwards, newest write first, and puts each entry back the way it was.

  1. Open Imports in the admin sidebar. The Jobs tab lists every run.
  2. Open the actions menu on the import’s row and choose Roll back.
  3. Wait while the dialog says Checking what a rollback would change…. This is a dry rollback: it writes nothing.
  4. Read the counts, then choose Roll back N entries to go ahead, or Keep the import to leave it as it is.
  5. The dialog shows the progress of each kind of change, then Rollback finished. From version 0.9.0, on a site whose scheduled tasks run, it also says You can close this. The rollback keeps running and shows in Jobs.
the Roll back dialog in the EmDash admin, with the counts of entries to delete, restore, bring back and keepthe Roll back dialog in the EmDash admin, with the counts of entries to delete, restore, bring back and keep
The Roll back dialog: a dry rollback first counts what will change, then you confirm.

The rollback appears in Jobs as its own row, Rollback of followed by the template’s name, and the import’s status becomes Rolling back, then Rolled back.

The dialog first says how many entries the dry rollback found and how many will change. Then it shows four counts:

Count Which entries What the rollback does
to delete Created by this import Deletes them.
to restore Updated by this import Puts back their fields, slug, terms, bylines and references, status, schedule and pending draft as they were before the import.
to bring back Moved to Trash or unpublished by it Restores them from the trash, and republishes the ones that were published. These come from the missing-entries step.
kept Edited since, locked or failed Leaves them as they are. See What can’t be rolled back.

Entries the import wrote that no longer exist, or that it never got to write, are counted apart: “N entries are already gone.” There is nothing to undo for them.

An entry the import published for the first time is unpublished again. An entry that was scheduled before the import gets its schedule back, unless that time has passed: then it stays a draft.

The rollback never overwrites work done after the import. It keeps an entry as it is, and counts it as kept, when:

  • it was edited since. An editor, or a later import, changed the entry after this import wrote it. Term changes count too. To undo several imports, roll back the newest first: once a later import is rolled back, the entries it changed are as the earlier import left them again.
  • it is locked. Someone has the entry open in the editor.
  • it failed. Another plugin’s hook refused the delete, publish, unpublish or schedule; an older value is empty in a field that is now required; or a created entry has translations that are still active.

The rollback’s log lists each kept entry with the reason. When the cause is gone (the editor closed the entry, or you rolled back a later import), use Retry the rollback on the rollback’s row in Jobs to try those entries again.

The rollback also leaves some things in place on purpose:

  • Media. Images and files the import downloaded stay in the media library, because EmDash can’t tell whether other content uses them. The rollback lists their IDs in its warnings, so you can delete them yourself.
  • Terms. Categories and tags the import created stay; the rollback says how many.
  • Entries an editor moved to Trash after the import created them are never deleted for good.

Roll back is offered on an import that has finished (completed, failed or cancelled) and has a journal. It is not offered for:

  • a dry run, which wrote nothing;
  • an import that is still running or paused: cancel it first;
  • an import that was already rolled back;
  • a rollback. A rollback can’t be rolled back; run the import again instead.

A rollback is possible only while the import’s record exists. The importer deletes job records after Keep import logs for (days), 30 days by default, on the plugin’s settings page. See Configuration and settings.

From version 0.9.0, the site finishes a rollback by itself: the same scheduled task that runs scheduled imports picks it up after you close the dialog. On Cloudflare Workers that task needs a Cron Trigger, and runs a small batch (at most 2 entries) each time; with the dialog open, the rollback goes as fast as before. Entries the scheduled task reverts are written with no user, as scheduled imports are.

Without scheduled tasks, and for a rollback started by version 0.8 or earlier, the rollback runs from your browser, one batch at a time, while the dialog is open. If you close the dialog or the page, it stops where it is, and nothing is lost: its row in Jobs offers Continue the rollback, which picks it up from the last entry it finished.

Rolling back an import a schedule ran pauses that schedule, so the next run doesn’t import the same feed again straight away. The dialog says Its schedule name will be paused. The schedule’s run log marks the run Rolled back. Switch the schedule back on when the feed is right.

A rollback also clears the URL source’s memory of that import, so the next import of the same feed runs in full instead of being skipped as unchanged.

Imports an agent ran through the MCP tools keep a journal like any other, and you roll them back the same way, from the Jobs tab. Agents themselves have no rollback tool.