How to remove Routers/Interfaces without lost the history:

Document ID : KB000126368
Last Modified Date : 07/02/2019
Show Technical Document Details
Introduction:
How to remove Routers/Interfaces without lost the history from the MySQL DB
Environment:
NFA 9.5
Instructions:
Example for Router IP Address: 100.200.300.400

1 - Stop all NFA services on Harvester and NFA Console machines:

2 - Run the mysql backup on Command Prompt:

NFA Console machine:
mysqldump -P 3308 reporter > C:\CA\NFA\backup\reporter_backup.sql

Harvester machine:
mysqldump -P 3308 harvester > C:\CA\NFA\backup\harvester_backup.sql

3 - Queries do Delete from Harvester machine:
mysql
use harvester
select * from routers where inet6_ntoa(router)='100.200.300.400'; (Note the routerID)
select * from interfaces where inet6_ntoa(router)='100.200.300.400';
delete from routers where inet6_ntoa(router)='100.200.300.400';
delete from interfaces where inet6_ntoa(router)='100.200.300.400';

select * from persistent_map where routerid='x'; (Inform the routerID from first select)
delete from persistent_map where routerid='x';

update parameter_descriptions set DefaultValue='true' where parameter='ignoreReboots';
update routers set PollState='InitialPoll', stateretry=0, reboottime=0 where PollState ='RebootRefresh';


NFA Console machine:
use reporter
select ID from routers where deviceName = '100.200.300.400'; (Note the routerID)
select * from interfaces where routerId = 'nnnnnnn'; (Inform the routerID from select above)
delete from routers where deviceName = '100.200.300.400';
delete from interfaces where routerId = 'nnnnnnn'; (Inform the routerID from select above)

4 - Start all NFA services on Harvester and NFA Console machines

5 - Wait 15 minutes to Validade
Additional Information:
For old NFA version use https://comm.support.ca.com/kb/router-is-not-displaying-on-nfa-console-even-though-flow-is-received-on-harvester/kb000031730