User calendar data wiped out

Get help from the community here.

Moderator: Developers

Posts: 74
Joined: Sun Sep 15, 2013 4:04 am

User calendar data wiped out

Postby jhsdurham » Mon Oct 06, 2014 6:06 pm

I have seen this same issue happen before with two different users. This time, I don't think I have a way to recover from it.

According to the Activity log, a user named Christine operating from a desktop in this office is tagged as having deleted EVERY single event in the calendar for a user named Chris that works in another office. All within 60 seconds. At the time this was happening, Chris was trying to add a new event on his calendar, and he says he got an error message about Object or Item not found. Christine had nothing to do with this, she wasn't even here!

Hundreds of events, for no reason, somehow deleted by a user not even logged in. What is the world is wrong with this thing?
Posts: 74
Joined: Sun Sep 15, 2013 4:04 am

Re: User calendar data wiped out

Postby jhsdurham » Mon Oct 06, 2014 7:03 pm

In case this happens to anyone else - here is how I was able to restore all the events.

Whatever tool you use for backing up your data, what you need to restore is this folder:
c:\ProgramData\MySQL\MySQL Server 5.6\data\(name of your group office data folder)

Restore the contents of it to an ALTERNATE name such as this:
c:\ProgramData\MySQL\MySQL Server 5.6\data\recoveredGO
This will enable to you open the backup copy of the database AND the active copy to do what you need to do

Open the MySQL Workbench CE tool
Open the item "Local Host" on the far left (double click it)
Expand the Schema that has your ACTIVE group office database name
Expand Tables
Find the table "go_users",
Right-click and choose Edit Table Data
Find the user NAME you need to recover, and note the ID# for that user
Go back to the list of tables in the schema and find the tabled called "cal_calendars"
Use Edit Table Data to view the data, and sort by clicking UserID column
In the far left is the ID column showing the ID for *the calendar number* for that user, note it, you need it later

Now you know what id# to export from the cal_events table to recover the person's data

Run this SQL command to get all the records for the user
SELECT * FROM recoveredGO.cal_events WHERE calendar_id = 83 LIMIT 0,10000; (whatever the ID# is for the calendar user)
This makes sure that you get ALL the records for that user by using those parameters.
Click the red down arrow above the SQL result list to export all the records to a file
Choose a directory to export
Choose "SQL Insert Statements (.sql)" as the export type,
Enter a filename (like usernameRECOVERED)
The export happens pretty quickly

Open a command prompt (CMD on the start menu)
Change to the directory where you exported that usernameRECOVERED.sql file
Run this command to import the .sql fiile
This imports all that person's events to your running GO calendar database

Now open WorkBench CE (if it wasn't still open)
Expand your ACTIVE group office schema and find the "cal_calendars table"
Sort the table by userID column
Find the NAME of the person you are restoring, and notice the ID column
You should see the value there isn't the same as what it was in the backup you worked with.
Change that ID column value to what the user WAS at in your backup copy
For example, in the backup the ID might have been 83 and now it says its 181. So set it to 83.
Click apply to complete the change to that table

Now open a web browser and look at that person's calendar. It should have events again.

Who is online

Users browsing this forum: No registered users and 4 guests