How to backup recods from the em_event tableSummaryIn the Event Management product documentation we don't recommend changing the default retention time for events (em_event). To log events for a longer time, it is suggested to create an archive table and a job that copies new events to it. Do this by scheduling a job to regularly back up events [em_event] to a custom table. This article shows an example of how this can be done.ReleaseAllInstructions1. Create a copy of the em_event table called u_em_event by going through the process explained in the article below. Note this will only create a copy of the table schema an not the data: How to create a copy of a table 2. Create a scheduled script job to run the sample script below daily. This script copies all yesterday's data from em_event table into u_em_event: var encodedQueryString = 'sys_created_onONYesterday@javascript:gs.beginningOfYesterday()@javascript:gs.endOfYesterday()'; var evt_src = new GlideRecord('em_event'); evt_src.addEncodedQuery(encodedQueryString); evt_src.query(); var evt_tgt = new GlideRecord('u_em_event'); while(evt_src.next()) { evt_tgt.initialize(); evt_tgt.additional_info = evt_src.additional_info evt_tgt.alert = evt_src.alert evt_tgt.bucket = evt_src.bucket evt_tgt.ci_identifier = evt_src.ci_identifier evt_tgt.ci_type = evt_src.ci_type evt_tgt.classification = evt_src.classification evt_tgt.cmdb_ci = evt_src.cmdb_ci evt_tgt.description = evt_src.description evt_tgt.error_msg = evt_src.error_msg evt_tgt.event_class = evt_src.event_class evt_tgt.event_rule = evt_src.event_rule evt_tgt.message_key = evt_src.message_key evt_tgt.metric_name = evt_src.metric_name evt_tgt.node = evt_src.node evt_tgt.processed = evt_src.processed evt_tgt.processing_duration = evt_src.processing_duration evt_tgt.processing_notes = evt_src.processing_notes evt_tgt.processing_sn_node = evt_src.processing_sn_node evt_tgt.resolution_state = evt_src.resolution_state evt_tgt.resource = evt_src.resource evt_tgt.severity = evt_src.severity evt_tgt.source = evt_src.source evt_tgt.state = evt_src.state evt_tgt.sys_domain = evt_src.sys_domain evt_tgt.sys_mod_count = evt_src.sys_mod_count evt_tgt.time_of_event = evt_src.time_of_event evt_tgt.type = evt_src.type evt_tgt.insert(); } 3. Example attached to this document includes the script include that contains the above code and the daily scheduled script execution.Related LinksAutomatically run a script of your choosing