We need to be able to mass restore archived records...is that possible? If so, how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 03:49 PM
We are moving, or already have moved to a CSM instance of service now and are soon to retire our old instance (end of year),
Now we need to move old data over from the old instance. I want to move our archived data. I am finding that I need to restore the RITM data to be able to retain the variables on them. If I don't restore, things do not work as needed.
But really, I just want to know if there is a way to mass restore archived records and NOT have to do them one-by-one. Which the latter is no feasible with having hundreds of thousands of records. I am assuming we'd need a script.
Anyone able to do this?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2022 12:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 07:20 AM
To restore records back man table fm_expense_lines from sys_archive_log with the help of filter like created (sys_crerated) after 2020-05-03
Note: For my case, the "sys_archvie_log" table is having crores of records so that the reaon i don't have option to check restore from the "sys_archive_log" table.
I am trying with the fix script bit its now doing the restore
restoreRecords();
var archr = new GlideRecord('ar_fm_expense_line');
archr.addEncodedQuery("sys_created_on>javascript:gs.dateGenerate('2021-05-03','23:59:59')");
//archr.orderByDesc('number');
archr.query();
function restoreRecords() {
var archiveGR = new GlideRecord('sys_archive_log');
archiveGR.addEncodedQuery('to_table=ar_fm_expense_line^restored=NULL');
archiveGR.query();
while (archiveGR.next()) {
new GlideArchiveRestore().restore(archiveGR.sys_id);
}
}