-
Notifications
You must be signed in to change notification settings - Fork 20
Restore from aem
Chris Millar edited this page Feb 19, 2025
·
3 revisions
There are times you may want to restore your content from aem.page
or aem.live
. If you have a list of pages you want to restore, you can simply plug them into DA's import app. If you want a more substantial restore, you can use AEM Admin APIs to get a list of your live content.
- Get the list of content from AEM
- Import the list of pages into DA.
- Validate.
curl -X POST \
'https://admin.hlx.page/status/geometrixx/outdoors/main/index' \
--header 'Accept: */*' \
--header 'X-Auth-Token: {{YOUR_AEM_ADMIN_API_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"pathsOnly": true,
"select": [
"preview"
],
"paths": [
"/*"
]
}'
This will return a response with a "self" property:
{
"messageId": "87ad2401-b961-417c-84ed-dfd27ec208c0",
"job": {
"topic": "status",
"name": "job-2025-02-14-18-07-24-d8d34679",
},
"links": {
"list": "https://admin.hlx.page/job/geometrixx/outdoors/main/status",
"self": "https://admin.hlx.page/job/geometrixx/outdoors/main/status/job-2025-02-14-18-07-24-d8d34679"
}
}
Send another request with the "self" URL and add /details
at the end:
curl -X GET \
'https://admin.hlx.page/job/geometrixx/outdoors/main/status/job-2025-02-14-18-07-24-d8d34679/details' \
--header 'Accept: */*'
It will return all docs, sheets, media, and redirects that are live on your site:
{
"topic": "status",
"name": "job-2025-02-14-18-07-24-d8d34679",
"state": "stopped",
"createTime": "2025-02-14T18:07:24.178Z",
"data": {
"paths": [
{
"prefix": "/"
}
],
"pathsOnly": true,
"select": [
"preview"
],
"phase": "completed",
"resources": {
"preview": [
"/.da/config.json",
"/home",
"......."
]
}
}
}
Once you have the list (in the preview array above), you can prefix the paths with your fully qualified aem.page domain. This is your list you will plug into the DA import app.
Use https://da.live/apps/import to import your pages.
- If you do not have CORs headers turned on for your site, you can use a browser extension to temporarily disable CORs. We're partial to this extension which allows you to simply plug in hostnames.
- The list above will include: docs, sheets, redirects, images, and video.
- Document redirects will be called out as not importable via the redirects import list.
- Media redirects will be followed and imported as the original media name.
