<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb" -->

---
title: Recover from accidental DynamoDB changes using Bulk Executor
description: When accidental writes corrupt a DynamoDB table, a full PITR restore is slow and expensive. The Bulk Executor `revert-export` command offers a faster...
canonical: https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Recover from accidental DynamoDB changes using Bulk Executor | daily.dev
og:description: When accidental writes corrupt a DynamoDB table, a full PITR restore is slow and expensive. The Bulk Executor `revert-export` command offers a faster...
og:url: https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb
og:image: https://api.daily.dev/og/posts/CJri60FEb.png
og:image:alt: Recover from accidental DynamoDB changes using Bulk Executor
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recover from accidental DynamoDB changes using Bulk Executor

**[AWS Database Blog](https://daily.dev/sources/aws-database-blog)** · 8 min read · 0 upvotes · 0 comments

## Summary

When accidental writes corrupt a DynamoDB table, a full PITR restore is slow and expensive. The Bulk Executor `revert-export` command offers a faster alternative: run an incremental export to S3 with `NEW_AND_OLD_IMAGES`, then use `revert-export` to write back the old state for each affected item. An optional Python transform lets you selectively revert only specific items, skip valid concurrent writes, or even fix data mid-revert. Cost and duration scale with the change set size, not the full table, making it far cheaper for large tables.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://aws.amazon.com/blogs/database/recover-from-accidental-dynamodb-changes-using-bulk-executor>

## Questions this post answers

### How can I undo accidental DynamoDB writes without restoring the entire table from PITR?

Use the Bulk Executor `revert-export` command with a DynamoDB incremental export to S3 configured with the `NEW_AND_OLD_IMAGES` export view type. The command reads the export, swaps each item's new image for its old image, and writes the pre-change state back to the table. Cost and duration scale with the number of changed items, not the full table size, making it far cheaper than a full PITR restore.

_Engineers dealing with bad data loads or migration rollbacks track tools like this on daily.dev._

### How do I selectively revert only some DynamoDB items during a revert-export operation?

Pass a Python transform file via the `--transform` parameter. The transform runs before the revert logic, receiving each item with its `old_image` and `new_image`. Return an empty array for items that should not be reverted, return the item to revert it, or modify `old_image` in place to fix data before writing it back. This lets you keep valid concurrent writes while undoing only the problematic ones.

_Teams managing complex DynamoDB migrations find selective revert patterns like this on daily.dev._

### What are the prerequisites for using DynamoDB Bulk Executor revert-export?

You need a DynamoDB table with PITR enabled, an incremental export to S3 in DDB-JSON format with `NEW_AND_OLD_IMAGES` as the export view type, AWS credentials with permissions for DynamoDB, S3, and AWS Glue, Python 3.11 or later, and the Bulk Executor tool installed from the awslabs/amazon-dynamodb-tools GitHub repository.

_Developers setting up DynamoDB recovery workflows find the latest tooling updates on daily.dev._

## Similar posts on daily.dev

- [Introducing open source Bulk Executor for Amazon DynamoDB](https://daily.dev/posts/introducing-open-source-bulk-executor-for-amazon-dynamodb-ixgq8yvbc) · AWS Database Blog · 0 upvotes · 0 comments
- [The DynamoDB Connector is now in Tinybird Forward](https://daily.dev/posts/the-dynamodb-connector-is-now-in-tinybird-forward-thq72ap70) · Tinybird · 3 upvotes · 0 comments
- [DynamoDB crash course: part 2 – data model](https://daily.dev/posts/dynamodb-crash-course-part-2-data-model-67qh0m1qw) · Planet Python · 0 upvotes · 0 comments
- [Scaling a Financial Reconciliation Pipeline With Serverless](https://daily.dev/posts/scaling-a-financial-reconciliation-pipeline-with-serverless-gynvqfhrg) · Cloud Native Now · 0 upvotes · 0 comments

---

Tags: [#aws](https://daily.dev/tags/aws), [#aws-s3](https://daily.dev/tags/aws-s3)

[View this post on daily.dev](https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Recover from accidental DynamoDB changes using Bulk Executor","url":"https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb"},"datePublished":"2026-08-10T16:07:27.005Z","dateModified":"2026-08-10T16:08:00.557Z","description":"When accidental writes corrupt a DynamoDB table, a full PITR restore is slow and expensive. The Bulk Executor `revert-export` command offers a faster...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/14c4cbb2998e3788bad37df17338b885?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/14c4cbb2998e3788bad37df17338b885?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"AWS Database Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"AWS Database Blog","logo":"https://media.daily.dev/image/upload/s--En-avd2a--/f_auto,q_auto/v1780213446/logos/aws-database-blog?_a=BAMAMiWQ0","url":"https://daily.dev/sources/aws-database-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"aws,aws-s3","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AWS Database Blog","item":"https://daily.dev/sources/aws-database-blog"},{"@type":"ListItem","position":3,"name":"Recover from accidental DynamoDB changes using Bulk Executor"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/recover-from-accidental-dynamodb-changes-using-bulk-executor-cjri60feb#faq","mainEntity":[{"@type":"Question","name":"How can I undo accidental DynamoDB writes without restoring the entire table from PITR?","acceptedAnswer":{"@type":"Answer","text":"Use the Bulk Executor `revert-export` command with a DynamoDB incremental export to S3 configured with the `NEW_AND_OLD_IMAGES` export view type. The command reads the export, swaps each item's new image for its old image, and writes the pre-change state back to the table. Cost and duration scale with the number of changed items, not the full table size, making it far cheaper than a full PITR restore. Engineers dealing with bad data loads or migration rollbacks track tools like this on daily.dev."}},{"@type":"Question","name":"How do I selectively revert only some DynamoDB items during a revert-export operation?","acceptedAnswer":{"@type":"Answer","text":"Pass a Python transform file via the `--transform` parameter. The transform runs before the revert logic, receiving each item with its `old_image` and `new_image`. Return an empty array for items that should not be reverted, return the item to revert it, or modify `old_image` in place to fix data before writing it back. This lets you keep valid concurrent writes while undoing only the problematic ones. Teams managing complex DynamoDB migrations find selective revert patterns like this on daily.dev."}},{"@type":"Question","name":"What are the prerequisites for using DynamoDB Bulk Executor revert-export?","acceptedAnswer":{"@type":"Answer","text":"You need a DynamoDB table with PITR enabled, an incremental export to S3 in DDB-JSON format with `NEW_AND_OLD_IMAGES` as the export view type, AWS credentials with permissions for DynamoDB, S3, and AWS Glue, Python 3.11 or later, and the Bulk Executor tool installed from the awslabs/amazon-dynamodb-tools GitHub repository. Developers setting up DynamoDB recovery workflows find the latest tooling updates on daily.dev."}}]}
```

