requests migrate
Use dynomate-cli requests migrate to convert a legacy collection of .toml files to DNML in the same folder.
It is the same as Migrate collection in the app.
Migrate a Collection
Give the collection folder with --collection, the only option:
$ dynomate-cli requests migrate --collection ./legacy
Migrated 1 request(s) in ./legacy. Original files were preserved. - The command converts all requests in the folder, not in nested folders.
- It writes the
collection.dnmlmarker only if all converted requests are valid. - It keeps the
.tomlfiles as a recovery copy, and does not changeenvironments/.
Review the new files before you remove the legacy files.
What Changes
Each legacy request becomes a .dnml file with the same name, operations and expressions. References become DNML templates. This legacy request:
name = 'recent-orders'
[[operations]]
type = 'query'
name = 'Find recent order'
tableArn = 'arn:aws:dynamodb:ap-southeast-2:111122223333:table/Orders'
keyConditionExpression = 'accountId = :accountId'
consistentRead = false
scanIndexForward = false
[operations.expressionAttributeNames]
[operations.expressionAttributeValues]
':accountId' = 'account#42' becomes recent-orders.dnml:
version = "1.0"
name = "recent-orders"
[execution]
onError = "continue"
[[dynamodb.query]]
name = "Find recent order"
tableArn = "arn:aws:dynamodb:ap-southeast-2:111122223333:table/Orders"
keyConditionExpression = "accountId = :accountId"
consistentRead = false
scanIndexForward = false
returnConsumedCapacity = "indexes"
[dynamodb.query.expressionAttributeNames]
[dynamodb.query.expressionAttributeValues]
":accountId" = "account#42" To keep the legacy behavior, the command adds:
[execution] onError = "continue", the DNML default error policy.returnConsumedCapacity = "indexes"on each query.returnValues = "none"on each update.
You can change these later. The marker changes too:
collection.toml (kept)
version = '1.0'
type = 'dynomate-collection'
created = '2026-09-10T12:00:00Z'
[metadata]
author = 'Docs' collection.dnml (new)
version = "1.0"
type = "dynomate-collection"
created = "2026-09-10T12:00:00Z"
[metadata]
author = "Docs" Failures
If a request does not convert, the command stops and shows the file and field, but no values from your files.
$ dynomate-cli requests migrate --collection ./legacy
MIGRATION_FAILED: ./legacy/recent-orders.toml: operations[0].consistentRead: required legacy field is missing (./legacy/recent-orders.toml) The command then removes the new files, and the collection stays a legacy collection. Correct the file and run the command again.
- A required field is missing, or an unknown field is present.
- The file name is not the request
name. - The operation type is not query, update, put or delete.
- A different
.dnmlfile has the same name. Move it, because the command never overwrites it.
A path that is not a collection fails immediately:
$ dynomate-cli requests migrate --collection ./does-not-exist
DNML_MISSING_FIELD: Collection marker not found (./does-not-exist/collection.dnml) Run It Again
You can safely run the command again. On a DNML collection, it changes nothing:
$ dynomate-cli requests migrate --collection ./legacy
Collection already uses DNML: ./legacy If a migration stopped, run it again. Converted files that match are not conflicts.
Run Before Migration
requests run does not run requests from a legacy collection. It shows the migrate command:
$ dynomate-cli requests run --collection ./legacy --request recent-orders --approval never
recent-orders: failed
MIGRATION_REQUIRED: Legacy collection requires migration. Run: dynomate-cli requests migrate --collection './legacy'
at ./legacy Exit Codes
| Code | Meaning |
|---|---|
0 | The collection now uses DNML. |
1 | Migration failed. The error is on standard error. |
2 | The arguments are not valid, for example no --collection. |