Restoring Archived records in bulk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 10:38 AM
Hello,
I am wanting to archive some historic data. In order to archive the org is asking for a backout plan for the archive. When I run an archive in test and then try to restore the archive it is only allowing me to restore one record at a time. It gives me the option to restore record and related but it still only restores the one record. I archived 189,000 records in test on complete table. Is there a restore the entire archive job that ran and not just individual records?
Thanks
- Labels:
-
Data Foundations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2023 07:21 AM
Hi Daniel,
I have just used the following fix script to restore more than 200000 archived e-mail records.
// Define the query to retrieve records from sys_archive_log
var query = "from_tableSTARTSWITHsys_email^to_tableSTARTSWITHar_sys_email^restoredISEMPTY";
// Get a GlideRecord for sys_archive_log based on the query
var archiveLogGr = new GlideRecord('sys_archive_log');
archiveLogGr.addEncodedQuery(query);
archiveLogGr.query();
// Loop through the records and restore each one
while (archiveLogGr.next()) {
// Use GlideArchiveRestore to restore the record
var und = new GlideArchiveRestore().restore(archiveLogGr.sys_id);
// Log the result of the restoration only if it fails
if (!und) {
gs.error("Failed to restore record: " + archiveLogGr.getDisplayValue());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 03:40 AM
How much time is required to restore 200000 data