Hi,
Our customer recently advised they were shifting our user accounts to a new Active Directory domain. As a result all of our accounts were re-imported from the new AD. I've now discovered all of my custom dashboards and reports have disappeared. I'm assuming this is because my account was effectively deleted and recreated.
There was a fair bit of work in these dashboards and reports, so I was hoping there might be some way for me to get them back from a backup (or similar) without having to do a full restore? Maybe some way to extract them from a database and associate them to my current user account?
Thanks in hope,
Ben.
Lost Dashboards/Reports After User Account Recreated
-
silverbenz
- Posts: 30
- Joined: Wed Nov 14, 2012 9:06 pm
Re: Lost Dashboards/Reports After User Account Recreated
Unfortunately, there's not currently a process to do this.
Take an XI backup first in case you make a mistake so you can restore it.
You would need to extract the backup file and then go into the mysql directory in the extracted backup and work on the nagiosxi.sql file.
Create a new file and put ONLY the xi_users and xi_usermeta (only add the create table AND the data insert sections from the nagiosxi.sql file for both the xi_users and xi_usermeta table), then replace all occurrences of xi_users with xi_usersold AND replace all occurrences of xi_usermeta with xi_usermetaold in that new file.
Then import the data:
Then find your OLD user_id and make a note of it:
- Change yourusername
Then find your NEW user_id and make a note of it:
- Change yourusername
Then run this command:
- Change YOUR_OLD_USER_ID
- Change YOUR_NEW_USER_ID
That should do it.
Once you're done, drop the extra tables:
Take an XI backup first in case you make a mistake so you can restore it.
You would need to extract the backup file and then go into the mysql directory in the extracted backup and work on the nagiosxi.sql file.
Create a new file and put ONLY the xi_users and xi_usermeta (only add the create table AND the data insert sections from the nagiosxi.sql file for both the xi_users and xi_usermeta table), then replace all occurrences of xi_users with xi_usersold AND replace all occurrences of xi_usermeta with xi_usermetaold in that new file.
Then import the data:
Code: Select all
mysql -uroot -pnagiosxi nagiosxi < yournewfile.sql- Change yourusername
Code: Select all
mysql -uroot -pnagiosxi nagiosxi -e "select user_id from xi_usersold where username = 'yourusername';"- Change yourusername
Code: Select all
mysql -uroot -pnagiosxi nagiosxi -e "select user_id from xi_users where username = 'yourusername';"- Change YOUR_OLD_USER_ID
- Change YOUR_NEW_USER_ID
Code: Select all
mysql -uroot -pnagiosxi nagiosxi -e "update xi_usermeta set keyvalue = (select keyvalue from xi_usermetaold where keyname like '%dashboards%' and user_id = 'YOUR_OLD_USER_ID') where keyname like '%dashboards%' and user_id = 'YOUR_NEW_USER_ID';"Once you're done, drop the extra tables:
Code: Select all
mysql -uroot -pnagiosxi nagiosxi -e "drop table xi_usersold; drop table xi_usermetaold;"-
silverbenz
- Posts: 30
- Joined: Wed Nov 14, 2012 9:06 pm
Re: Lost Dashboards/Reports After User Account Recreated
Thank you @ssax!
I'll give this a go and let you know.
I'll give this a go and let you know.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Lost Dashboards/Reports After User Account Recreated
Hi,
Sounds good. Just update this thread when you're readyI'll give this a go and let you know.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!