Thursday, June 20, 2019

SnTT - Rooms and Resources Accidentally Delete a Resource and the Reservations

Last week I gave a session where I outlined a bunch of things I would like to see in the new Rooms and Resources database template should it get updated.

Yes some things were just more defined views, but other things that would make it more useful to admins, and users, were also included.

Well yesterday I learned the hard way about some things I knew, but I guess had not quite gotten to fix yet. Let me explain.

One of my clients has some very full RnR databases, 1 per region. Sometimes, against my preference, names or very similar names, are used in different places.

Tasked with clearing some old rooms, I set out to do just that and get on with my day.

And, of course, as you may have guessed, I deleted an active room.

Very active room.

400 reservations active.

As I saw when the pop up asked me if I wanted to notify people. I said no to that, knowing I can fix this. Well a few hours later, here is what really happened.

Oh.Yes.I.Did.

Domino problems are caused by admins, truth (except for developer agents that run amok).

I say, no problem, go to trash and undelete it. No Trash View in this R9 template. Note to HCL, please add one. Go into developer mode figuring it would be in the hidden view.

No

Call client developer and ask what they think, SOL. Soft deletion was not turned on.

Damn. Thought we had enabled it after last issue, but maybe the template got written over in an update or a restore and maybe we had only set soft deletions in the database itself and not the template.

In any event, I was blocked this route.

Call restore team, can you provide me with a backup from the prior 24-48 hours ASAP?
Yes, no problem they said.

Great, restore completes and I go to try to get back the data and...it shows me what I see now, not what I should have seen for a day ago.

AGH!

Call restore team, ask how it is possible. Well replication was on, ok, try again, turn it off this time.

And get notification, go open it up, same problem!

Well now I am confused. Got the team together to figure it out, and it seems they do incremental backup sand logs.

I said I don't want logs just data.

And 3rd time lucky, I open it up and it is the old data. Perfect, I start to copy a doc to test that pasting it back in will work.

BAH! No dice, this database doe snot allow pasting of documents.

WHAT!?!?!?!?!?!

Call back the developer, ask how I, as the admin, can not do this. Well, she knew why and where to look to fix it. And now I will let you know because someone out there will read this after pulling their hair out.

Open the database in the Designer client and go to the views section.

Find the view you need to paste into, you will need 2 of them.
The first is the resources view itself because you need to copy back the deleted resource.
The second is the view of Reservations, by Resource so you can paste back all of the reservations you killed accidentally.

Once you have the view open, locate the Querypaste section as shown in the graphic below and REM out all of the code there and save it.



















Once you do this and reopen the database you should be able to paste everything back in.

Then run a Fixup and Updall to get everything cleaned up and reindexed and then test making a reservation that honors used and open times.

You learn something new every day, even after all these years.

EDIT: Adrian asked me on twitter about Adminp and Busytime. I forgot to discuss it, so here is what we did and what you should check.

Adminp at the customer is set to run on a set schedule, so it did not worry me, but you should go into the database and clear the delete request otherwise you will lose the setting in the names.nsf for the resource.

Busytime, I did not rebuild it because my tests showed it was working. Presumably because the dates/times had been in the database already and did not update but if you run into problems, you should follow the technote and clear the old busytime and let a new one start.

No comments:

Post a Comment