5 Replies Latest reply on Oct 24, 2013 4:27 PM by philmodjunk

    "Damaged" database and how to copy tables from one to another?

    jhc

      Title

      "Damaged" database and how to copy tables from one to another?

      Post

           After being told my nested portals won't work I am editing my form. Then I got the nasty message about my database being damaged and to use the recover command. I checked the help and it gave me info about a script. But where do I run this script? Do I create a new button inside my damaged database to recover? 

           Also, the last time this happened I gave up and started from scratch. But this will be my third time and recreating 6+ tables is getting tiresome. Is there some way to copy all the tables and their relationships from one .fmp to another .fmp? Or at the very least, copy their table structures so I'm not copying and recreating all the various field names, relationships, and lookup tables? 

        • 1. Re: "Damaged" database and how to copy tables from one to another?
          philmodjunk

               You need to figure out why your file keeps ending up damaged as this is not typical behavior.

               

                    "I checked the help and it gave me info about a script"

               What script would that be? What is it supposed to do? What did you look up in help that referenced a script?

               What did you get when you ran the recover on your file?

               Do you save backup copies of your file. Not only does this protect you from having to rebuild your file from square 1, it can also help protect you from "developer remorse" where you make a major change to the design of your database and then realize that it wasn't such a great idea after all, only to have to do a lot of work to get it back to the original form due to the automatic saving of your changes.

               See this thread for a script that can save back up copies of your file on regular intervals while you are developing it: Saving Sequential Back Ups During Development

               Your message title refers to Copying tables from one file to another. This can be done in FileMaker Advanced. In FileMaker Pro, you can use import records with "new table" selected as the target table to import both the data and the table itself into a different file. But if the table is damaged, either method may bring that "damage" along with the table. And any relationships linking your tables cannot be imported or copy/pasted, you have to recreate them one relationship at a time. angry

               And layout objects can be copy/pasted from one file to another with the same risk of bringing in the file damage along with the pasted objects.

               See this thread for what this can entail: Importing Layouts

               IF you do bring over parts of a damaged file into a new file, do a recover on the file after each such paste or import to see if recover reports the file as undamaged or not.

          • 2. Re: "Damaged" database and how to copy tables from one to another?
            jhc

                 When I hit the help button in FileMaker Pro and search for the term "recover" it gives me a page about Recover but I don't know where I'm supposed to run this command or how to use it. It's just one of the many script pages within the help files. Unfortunately it's not a website so I can't give you a URL. It's just in FileMaker Pro  Help and it's the second line returned after the search. 

                 The only reason I searched for that term is because that's what the error message told me to do - but having no idea how to do it I went to the help page which unfortunatley doesn't have enough detail to let a newbie like me know what I'm supposed to do. Is that supposed to be linked to a button on my damaged form? Or from a totally different form? 

                 I'm just guessing but I think the damaged files happen when I tried to remove the portals. In this case I was going to get rid of the portals and set it up with the Nets and the Traps page instead of off tabs in the lakes page. But when I hit the Save Changes button that's when I got the error message mentioning damaged database and suggesting I use "recover" to fix it.  Last time I got this I was also removing portals (that time I wasn't nesting them) but something broke and I got the error message about damaged database and using the "recover" tool.

                  

            • 3. Re: "Damaged" database and how to copy tables from one to another?
              philmodjunk

                   Well it's not a script. Close the file, but leave FileMaker Running. Select Recover from the File menu and select your file in the dialog that pops up as the file to be recovered.

                   

                        I'm just guessing but I think the damaged files happen when I tried to remove the portals.

                   That seems very unlikely to be the cause of damage to your file unless some other factor is invovled. Where is your file located? On the machine you are using or somewhere else on your network?

                   Have you used a utility to check and see if the hard drive where the file is stored is free of problems? (Seems like the issue occurred when FileMaker tried to "write" data to the drive where it is stored.)

                   Things to keep in mind about Recover:

                   While Recover almost always detects and fully corrects any problems with your file...

                     
              1.           The recovered copy may behave differently even if recover reports "no problems found".
              2.      
              3.           Recover does not detect all problems
              4.      
              5.           Recover doesn't always fix all problems correctly
              6.      
              7.           Best Practice is to never put a recovered copy back into regular use or development. Instead, replace the damaged file with an undamaged back up copy if this is at all possible. You may have to save a clone of the back up copy and import all data from your recovered copy to get a working copy with the most up to date information possible.

                    

                   And here's a knowledgebase article that you may find useful: What to do when your file is corrupt (KB5421).

              • 4. Re: "Damaged" database and how to copy tables from one to another?
                jhc

                     my file is located on a shared network drive. We do get intermittent network problems but I don't remember if they were plaguing us the last time this happened. Today I lost access to my email shortly after I got the damaged database error message.

                     Looks like I'll have to start from scratch again. very very sad.  Hopefully 3rd times a charm.

                • 5. Re: "Damaged" database and how to copy tables from one to another?
                  philmodjunk

                       When doing development work on the file, I strongly recommend that you copy the file to your local machine and only save or copy the file back to the server when done making changes for the day. If there is any kind of network glitch--which may or may not be observable by you, during a "write" back to the shared directory made to save a design change to your file, you can get a damaged file as a result.

                       And NEVER, EVER, share a file between users by putting it in a shared directory where they can double click the file to open it. If two users try to open the file at the same time, you can get a damaged file.