Upgrade your Content Fragments for UUID References upgrade-content-fragments-for-UUID-references
To optimize the stability of your GraphQL filters, you can upgrade the content and fragment references in your Content Fragments so that they use universally unique identifiers (UUID).
Originally Content Fragment Models provided the data types of Content Reference and Fragment Reference. Both of these references use a path to point to the referenced resource, and this path can become outdated if the resource is moved. Although such references are more than sufficient in most scenarios, Content Fragment Models have been extended to also provide references based on a UUID:
- Content Reference (UUID)
- Fragment Reference (UUID).
These new reference types can be used both in new Content Fragment Models and Fragments, and to extend existing instances.
To upgrade existing Content Fragments and Models, you can run the procedure documented here.
What is upgraded what-is-upgraded
The following updates are made:
-
Fields of the data types:
- Content Reference are converted to Content Reference (UUID)
- Fragment Reference are converted to Fragment Reference (UUID)
-
The values of the path based references held in these fields are replaced by the corresponding UUIDs
What is NOT upgraded what-is-not-upgraded
The following references are not upgraded:
-
Page references - UUIDs are not supported yet
-
Any invalid references; for example, where the target of the Content Fragment path, or Asset path, does not exist
-
Invalid references are not upgraded, as if the Content Fragment path, or Asset path, is invalid there is not a corresponding UUID to assign. The original reference remains untouched.
-
Use a dry run to detact any invalid references.
note note NOTE Being invalid, they are not usable, irrespective of the upgrade. -
When you should not upgrade when-you-should-not-upgrade
Do not upgrade:
- When any of your Content Fragments use page references; as UUIDs are yet not supported for page references
Limitations of UUID references limitations-of-uuid-references
Currently the following limitations apply when using references based on a UUID:
-
Models
- New Content Fragment Models with either Content Fragment UUID or Content Reference UUID fields cannot be created via OpenAPI.
- The
id
field for models has not been changed to be UUID based. It uses the base64 decoded path of the model. Models cannot be moved, therefore, this value is still stable.
-
Assets
- When creating a Content Fragment via OpenAPI,
fragment-reference
orcontent-reference
field types must be used for specifying references to a fragment or an asset respectively - even when setting the value of a UUID based reference field.
- When creating a Content Fragment via OpenAPI,
Upgrade Planning upgrade-planning
There are a few preparation steps before running your upgrade.
Execute a dry run execute-a-dry-run
It is recommended that every time you upgrade your content, you first perform a dry run. This will create log files with entries that highlight any potential issues:
- Invalid references
- Page references
Run the content upgrade in dryRun
mode to:
- identify any invalid references; by listing them in the log files
You can then fix these references, before running the actual content upgrade. - identify any page references; by listing them in the log files
When page references are detected you should not run the content upgrade.
Enforce a content freeze enforce-a-content-freeze
Execution of the content upgrade should be planned during a content freeze period.
The duration of the content freeze depends on the volume of Content Fragments being upgraded. Accordingly, the upgrade can range from a few minutes up to a few hours, and also depends upon the parameters used when starting the content upgrade.
Running the content upgrade running-the-content-upgrade
The content upgrade can be managed using the endpoint: /libs/dam/cfm/maintenance.json
Administrator
role to access the endpoint.Start a content upgrade start-a-content-upgrade
/libs/dam/cfm/maintenance.json
POST
start
uuidUpgradeService
1000
/conf
Specify either:
- the root
/conf
to upgrade all the AEM configurations - a selected AEM configuration path. for which the content upgrade is executed
For example:/conf/wknd-shared
only upgrades the single tenantwknd-shared
10
replicate
, noReplicate
replicate
: replicates the same job on all AEM Publish instancesnoReplicate
: only runs the job on AEM Author instances
true
, false
false
: simulate the content upgrade, without saving any content changestrue
: perform the content upgrade, and save content changes
UUID
The ID of the job that executes the content upgrade.
- This ID is required in any subsequent calls related to this execution.
- If the
mode
value is set toreplicate
, execution on AEM Publish instances also need to be under the samejobId
.
Example Content Upgrade Request example-content-upgrade-request
code language-http |
---|
|
code language-http |
---|
|
Get the status of a content upgrade get-the-status-of-a-content-upgrade
/libs/dam/cfm/maintenance.json
GET
<UUID>
jobId
that was returned from the call to start the content upgrade.Contains the detailed status of the content upgrade:
-
Updated after every interval (seconds).
-
uuidUpgradeService
execution has two phases:- phase-0 to upgrade content fragment models
- phase-1 to upgrade content fragments
-
In each phase, statistics are updated after every interval.
-
“jobStatus”: “COMPLETED” marks the upgrade as successfully completed.
-
Other status values are self-explanatory.
Example Content Upgrade Status Request example-content-upgrade-status-request
code language-http |
---|
|
code language-http |
---|
|
In addition to the status of a running content upgrade obtained from the HTTP endpoint, AEM logs provide detailed information of the progress on the content level. For example:
code language-xml |
---|
|
Additionally, after the processing of each segment (batch) of Content Fragments and Models, an accumulated status is logged, summarizing the progress so far. For example:
code language-xml |
---|
|
Abort a content upgrade abort-a-content-upgrade
- does not revert any changes already made
- might leave your content in a mixed state
/libs/dam/cfm/maintenance.json
POST
<UUID>
jobId
that was returned from the call to start the content upgrade.Contains the detailed status of the content upgrade:
- The status to note is “jobStatus”: “ABORTED”.
After an abort action, any pending segments of data will not be processed. - If the jobStatus is “COMPLETED” before an abort, the call does not have any effect.
Example Abort a Content upgrade Request example-abort-content-upgrade-request
code language-http |
---|
|
code language-http |
---|
|