8 Replies Latest reply on May 13, 2013 7:20 AM by LabsRock

    Duplicate files in Databases Folder


      Hi All,

      Perhaps this is documented already, but it seems worthy of noting here since it has been causing me about a week (maybe longer) of tumoil. I have a couple of databases that I've built for a client who hosts them on their server (managed by their IT Dept.) with many other FileMaker databases used by their organization. They are running FMS 11 Advanced on a Mac Server.


      This past week they reported that a huge amount of data had been lost from one of my databases. In looking into it I found that indeed the last record entered was from June 2012 - they pretty much use this system daily so this is significant. We were able to get all but one day's worth of the data back from a backup. I have spent most of the past three days trying to figure out exactly what happened. I finally requested, and was given, remote access to their server, not just the FileMaker Admin Console. I found that they had multiple occurances of the same file within different folders in FileMaker Server's Databases folder. It looks like when the server was set up they copied data from the old server by copying the folder, then also created a second folder and moved files to that as well. FMS only opens one copy of each file so everything seems hunky-dory when looking at the databases list in Admin Console. And for the most part it seems to function properly although I'm beginning to think some of the performance issue they've had (things just never ran as quickly as I thought they should and they seemed to get disconnected due to network issues more frequently than I usually see) may be due to this.


      Here's what I'm now attributing the lost data to based on a review of the logs and backups. They run a nightly backup of the entire directory. On Tuesday night the backup ran as usual and no errors were reported. However, when the databases started back up after the consistency check it looks like a different copy of the file in question was opened. I believe this copy, in a separate folder, had simply been sitting there since June 2012. There didn't seem to be any indication of a problem with the backup and the log shows that the file past the consistency check. Only problem is, I can't really tell from the log which file of the two is being backed up, checked for consistency, etc. because it only gives the file name not the path information.


      I'd welcome feedback from others. Does this seem to be a reasonable conclusion based on the information? Is ther something else I should check? Obviously having multiple copies of a file in the databases folder is a long way from a best practice - and something I'd never do. But I don't think I've ever seen documentation indicating that it shouldn't be done. Should FileMaker's backup be "smart enough" to track which file it backed up and which one it should open again when there are two files with the same name? Should this be reported as a bug?





        • 1. Re: Duplicate files in Databases Folder

          FMS will always back up the file that it is currently hosting, it is not going to backup a file that is in its "hostable" folder structure but that is closed.  So the part in your description where you say "They run a nightly backup of the entire directory" is not correct; unless you meant something other than FMS' backup schedule.  FMS does not backup files from a directly, just the files it has open.  If there is another backup process touching the folders with live files in it; then that has to be stopped.  It's a known cause for corrupted files.


          I think your assessment of the situation is correct.  It shows a lack of understanding of their IT's side of how FMS hosts files and where it looks for them.

          • 2. Re: Duplicate files in Databases Folder

            Thanks for the reply.  I guess my wording made things a little muddy.  They aren't running other backup software on the live files.  What I meant by the entire directory is that FileMaker Backup is set to backup everything in the databases folder.  It does only backup the live files so each file only shows up once in the FMS backups.  But where it looks like something slipped up is which file were opened after the backup completed.  What I found was on Monday's backup the file in question is in one folder, then on Tuesday's backup it is in a different folder.  Both files are still on the computer as before (i.e. a copy in each of the two folders), it just looks like FMS Backup switched files when opening them again.  It seems strange, but I can't think of any other way this could have happened.  There is no other indication in the log of that file being open/closed, only during the backup.  It passed the consistency check after backup so my first thought, that the first file didn't pass the consistency check which allowed FMS to open the second file doesn't seem to have occurred.


            Bottom line is there just shouldn't be files with the same name anywhere in the Databases folder - there's no need since FileMaker will only open one anyway.  I'll try to work with their IT Dept on this next week because it looks like this problem could go well beyond just my database.  What gets me is, without tracking this down it looked for all the world like my FileMaker database just lost almost a year's worth of data without so much as an error message.  Looks bad for me, looks bad for FileMaker.



            • 3. Re: Duplicate files in Databases Folder

              Hi Craig,


              Since you are running FMS on a Mac, I think you should take a look at Rob Russell's shell script which is a very good way of acrchiving the Backups which FMS has made on a separate volume. The script works best when you only keep one backup in the FMS Backups folder.




              I've run that script for several years now and have a complete set of daily archives, as well as hourly archives in a separate folder for recent days.


              To me it seems that your Users have somehow accessed one of the copies when they should only be working on the current file. I don't see any need for you to have any more than one current version of your file on the FM server. In my opinion all of your historical files are better off stored as zipped archives on a separate HD. That way you have to undertake some deliberate actions to open them -- presumably to retrieve some historical data for whatever purpose was necessary.


              I hope that helps, but don't hesitate to ask if you need further info,



              • 4. Re: Duplicate files in Databases Folder

                Thanks for your input John.  I'm writting up some recommendations for my client and the way they manage their FM server today.  Hopefully the solution is simply getting rid of the duplicate files in the databases folder.  The trick at this point will be determining which is the current live copy.  I've sorted this out for my files and removed the duplicates but there are a lot of other files they'll need to work through.  The simplest solution to that problem that I've come up with is to replace the entire contents with a backup made immediately before swapping theings out.  They'll just need to make sure they keep all those other files somewhere in case they need to go back to them.


                I'd still like to figure out exactly why this happened now.  I've found nothing to indicate why, after almost a year, the system opened a different file after the backup.  I guess the larger question is, has this happened in other instances and just gone un-noticed or worse yet simply been attributed to unstable databases/database software.  They have over 70 files running on that server, I only hear about four of them.  Could something similar have happened in the past to other users?


                I'll take a look at Rob Russel's shell script and let their IT Department know about.  Could be something they want to implement moving forward.



                • 5. Re: Duplicate files in Databases Folder

                  Hi Craig,


                  I'm writting up some recommendations for my client and the way they manage their FM server today.  Hopefully the solution is simply getting rid of the duplicate files in the databases folder.


                  I hope you can be appropriately emphatic over the necessity to have ONLY ONE version of the served file in the Databases folder. FMS has its own way of managing the files in that folder. For example, you would need to close any file before removing it from that folder. Only then can you be sure that a newly uploaded file will be the one that is served.


                  Trying to diagnose the cause(s) of what you observed is probably a fruitless exercise as you'll be unlikely to win a confession that someone meddled with the FMS configuration in a way that they shouldn't have. Sounds to me like it is time for a thorough clean out and reconfiguration of that server, even if it does mean some serious down time for the users.  You may even have to be ruthless and state that your file(s) must be hosted some place else, where it, or they, will be properly managed.


                  I don't envy your task but Good Luck!



                  • 6. Re: Duplicate files in Databases Folder



                    You said,


                    On Tuesday night the backup ran as usual and no errors were reported.  However, when the databases started back up after the consistency check it looks like a different copy of the file in question was opened. 


                    As I understand FMS backups, the hosted files are not closed and then re-opened, but only paused during the backup process; so this doesn't sound plausible to me. However, I'm wondering if there was some other issue - perhaps an automatic update that forced a restart with FMS automatically relaunching - and THEN FMS opened an older/different file?


                    Still, I agree: there are too many duplicates in the mix.


                    Debi Rubel

                    FullCity Consulting

                    • 7. Re: Duplicate files in Databases Folder

                      Debbie, thanks so much for pointing this out.  I reviewed the log again and you are exactly right.  I either was just scrolling too fast or possibly wasn't showing all records - there was another restart of FMS.  In the log it occurs right after the backups although the time was at 2:00 in the afternoon, clearly not associated with the backup as I originally thought.  Obviously I wasn't paying close enough attention here and am probably guilty of jumping to an erroneous conclusion which then clouded my judgement.


                      I'm not sure why the FMS engine was restarted in the middle of the day (or why when I asked if anything had happened that day on the server the answer was "no"), but I'm relieved that I'm no longer looking attributing this to the FMS Backup system, even indirectly.


                      Of course the practice of having multiple copies of a file within the Databases folder hierarchy is still a very bad idea.  I wonder if FileMaker Server should have a way of testing for and at least flagging this for the Administrator?  Since pretty much any OS will allow you to have files of the same name as long as they are in different folders, but FMS will start all FileMaker files regardless of their position in the underlying folder structure, seems like this might be an advisable "safety check."


                      Thanks again,


                      • 8. Re: Duplicate files in Databases Folder

                        Hi John,

                        Thanks for your input.  You're correct, I'll need to work with their server administrator on this a bit, but given the circumstances I don't think it will be a problem.  I've been working with these folks for quite some time and although I'm not familiar with the person currently managing the FMS, I do have a good working relationship with several others in the department.  And fortunately there is a strong commitment to FileMaker among staff.


                        Also, see my response to Debbie's post - it no longer looks like the FMS backup routine was involved but rather a separate restart of the FMS Server engine (as you suggest).  So now I'm shifting to finding out why the server engine was restarted in the middle of the day.