Yikes! =A0Severe Damage to DB - Menus Gone in Editor

Randy Engle (5/29/14 1:09PM)
Randy Engle (5/29/14 2:38PM)
Randy Engle (5/29/14 2:42PM)
Tim Nevels (5/29/14 4:34PM)
Ben Kershaw (5/29/14 5:32PM)
Joshua Fletcher (5/29/14 10:53PM)


Randy Engle (5/29/14 1:09 PM)

<<!&!AAAAAAAAAAAYAAAAAAAAAHuqyL9BU7RPvZs4aFc5Q6XCgAAAEAAAALUrd3ilVjNPqadNO
JN5psYBAAAAAA==3D@xc2.us>


I could use some serious recommendations for this one:

This is 4D v14.1 (Windows)

This db is our main product. ?(700 installations)
It has a large structure 200+ tables, 800K+ lines of code, tons of
forms, web code, etc.
It started in 4D 6.x (I think... long time ago, maybe even 4D 3.x...)
I've been going along just fine.

I needed to add a new menu item to a menu

And Gazzounds! ?Menus are gone in the menu editor!

The menus were displaying just fine in the Custom/Runtime environment.
So I had no reason to suspect foul play.
Until I opened the Menu Editor... Gone!
Then, they were all gone in Custom env.
Any code reference to a menu item invoked an error.

I looked to my backups, the last one where menus are still showing in
the menu editor is 2 1/2 weeks ago.
(I'm backing up 2x/day)
A lot of code has been written between then and now
Not to mention some other major changes.

I don't recall any bumps along the way.
What the heck could have caused this???

I tried using MSC to do a Repair - Unrepairable! ?Ouch!

If you were me, would you:

a.Go to the last backup and copy all code since then to that
version
(That's a lot of code and other items....!)

b.Try to add menus to the version that is foobar (and hope it
works)
(of course "Moving Objects" between databases is not a feature)

c.Add menus completely programmatically as needed

d.Go get a job selling ice cream cones to kids

e.????

Gracious thanks.
Any suggestions most appreciated.

Randy Engle
XC2 Software LLC

Randy Engle (5/29/14 2:38 PM)

<<!&!AAAAAAAAAAAYAAAAAAAAAHuqyL9BU7RPvZs4aFc5Q6XCgAAAEAAAALaKSaX6re5Hikwtq
tZknTYBAAAAAA==3D@xc2.us>


Hi Ben,

Re:
color><param>00000,0000,DDEE/param>
What happens if you restore to a version before you opened the menu
editor (but one that is more recent that 2.5 weeks ago) - does MSC
still
report it as unrepairable? Maybe opening the menu editor is what
finished
things off and made it unrepairable, and putting it through MSC will
fix
/color>tthe
color><param>00000,0000,DDEE/param>ddamage.
/color>
Good idea!!!
I'll give it a try.

Randy Engle
XC2 Software LLC

Randy Engle (5/29/14 2:42 PM)

Cc: 'Tim Nevels' <timnevels@...
<<!&!AAAAAAAAAAAYAAAAAAAAAHuqyL9BU7RPvZs4aFc5Q6XCgAAAEAAAAA2Wo79JHxtDrOL/g
MX/XOABAAAAAA==3D@xc2.us>


Tim,

Thanks for the detailed response.

Yes, option "A" is certainly the way to go.
I think I was hoping for something else.

Arrrgggh!

Thanks

Randy Engle
XC2 Software LLC

Tim Nevels (5/29/14 4:34 PM)

On May 29, 2014, at 3:20 PM, Randy Engle wrote:

color><param>00000,0000,DDEE/param>II don't recall any bumps along the
way.
What the heck could have caused this???
/color>
I have a v12 structure file that has come corrupted menu bars. MSC
does not find any problems, but if I try to access these menus in the
editor and make any changes to them weird things happen. I can delete
them, but as soon as I create a new menu the problems reappear. I have
just renamed the menu bars (corrupted) and leave them alone. I can add
more new menu bars and they work fine. The corrupted menus are very
old, probably created with 4D v6

The structure file has over 20 menu bars. Some day, when I have 6 or 8
hours to spare I will document all the menu bars and menu items,
delete all menu bars, and MSC repair. Then I will recreate all the
menu bars over again -- being careful to recreate all the many
hundreds of menu items over again with all the proper settings. It
will literally take at least a full day to do this. I'm lazy and don't
want to put in the time. But some day I will have to do it. (I'm
actually hoping a future version of 4D and MSC will be able to find
the corruption and fix it for me.)

color><param>00000,0000,DDEE/param>II tried using MSC to do a Repair -
Unrepairable! ?Ouch!
/color>
If MSC says the structure is "unrepairable" then the decision has
already been made for you. You abandon this structure file. It is my
opinion that you absolutely must have a structure file that MSC says
is OK and can be compacted and repaired without error.

color><param>00000,0000,DDEE/param>IIf you were me, would you:

a.Go to the last backup and copy all code since then to that
version
(That's a lot of code and other items....!)
/color>
That's what I would do. Use "Find in Design" and "where modification
date of parent" to give you a starting list of things to copy. And
before you start copying anything, play around with the menu editor
and make sure you can add and delete and edit menus in the backup
copy. Relaunch 4D multiple times during these tests and run MSC a few
time. You want to make sure your backup structure copy really is in
good shape.

color><param>00000,0000,DDEE/param>GGracious thanks.
Any suggestions most appreciated.
/color>
Maybe also open a tech support case and send this damaged structure
file to 4D so they can analyze it and add a repair option to MSC.

Tim

Ben Kershaw (5/29/14 5:32 PM)

Randy Engle wrote:

color><param>00000,0000,DDEE/param>IIf you were me, would you:
a. Go to the last backup and copy all code since then to that version
b. Try to add menus to the version that is foobar (and hope it works)
c. Add menus completely programmatically as needed
d. Go get a job selling ice cream cones to kids
/color>
Wow - that&iacute;s quite a punch to the stomach. If I were you I&iacute;d go with
option b, mainly because option a seems more error prone, and I&iacute;d add
code to verify the menu structure on each startup of the development
version to make sure it doesn&iacute;t happen again.

Theoretically option a is the better option, provided you can be sure
that it&iacute;s a &igrave;known good&icirc; backup, but you thought all the ones
after
that were good too.

What happens if you restore to a version before you opened the menu
editor (but one that is more recent that 2.5 weeks ago) - does MSC
still report it as unrepairable? Maybe opening the menu editor is what
finished things off and made it unrepairable, and putting it through
MSC will fix the damage.

Good luck! Keep us informed, if you can.

Regards,
Ben Kershaw

Joshua Fletcher (5/29/14 10:53 PM)

color><param>00000,0000,DDEE/param>aa. ?=A0?Go to the last backup
and
copy all code since then to that version
?=A0?=A0?(That's a lot of code and other items....!)
/color>
Because the Repair was unsuccessful, this is the only safe way to
proceed IMO, but I'm biased given my background in support.

Are you using revision control software? It could really help here
even if you've never used it. For example:

(note: in all cases make copies of everything! :)

1. Install the VC_Framework and VC_Forms components in a known good
copy of the database.
2. Launch it and export all the content. Methods and forms in this
case, but you could also export the structure definition with minimal
effort to catch changes to tables and fields. You can export just
about everything else too (lists, picture library, menus, users, etc.)
but it takes some code. The point is to get everything out into text
files so you can diff them.
3. Commit all that using your RC software (note: your local copy is
called the "working copy").
4. Copy the bad database over the good database in the working copy;
meaning overwrite anything that conflicts. The RC software will
immediately detect which files are changed even if they're binary.
5. Delete the "vc_data", "vc_forms", and "vc_source" folders (these
were created by VC_Framework and VC_Forms in step 2).
6. Launch the bad app (VC_Framework and VC_Forms are already
installed).
7. Export all the content again.

Your RC software will be able to show you which methods and forms were
added, changed, or deleted as well as what was changed in each file
via diff'ing. For example if you open a commit dialog in most SVN
clients it will show you a list of everything that's been changed.
?Use this information to "import" the changes into a known good copy.

https://github.com/4D/vc-framework-v14
https://github.com/4D/vc-forms-v14

There's even a fork of VC_Framework that supports method import, but I
haven't used it so I don't know for a fact would help you here:

https://github.com/elutz/vc-framework-v13

I think the idea would be (continuing the steps above):

8. Overwrite the bad app with the good app.
9. Launch the app.
10. Lutz's import routine will detect the new and changed methods on
disk and import them into the database.

So you could at least automatically fix the methods.

Kind regards,

Josh

--
Josh Fletcher
Technical Account Manager
4D, Inc

P.S. if you're going to use SVN, also install VC_SVN:

https://github.com/4D/vc-svn-v14

Reply to this message

Summary created 5/29/14 at 7:36PM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com