1 Reply Latest reply on Aug 13, 2009 9:05 AM by philmodjunk

    Backing up and loading backups



      Backing up and loading backups



         In my solution I have a script that will create a copy of the database and call it the filename and add the timestamp. It works fine. 


      Then I have a script that allows users to navigate to any backup, and import those records into the main database. The script works fine, except that if the users cancel in the middle of the import, the whole database is messed up. The is no problem if they enter their name and password and select "Remember password in computers keychain". 


      Any suggestions on how I can make it so the import doesn't get interruped. I think I can do it as long as I know what the filename is going to be, but I won't.






        • 1. Re: Backing up and loading backups

          If your import is adding records (rather than updating them):


          Immediately after an import, the imported records will reside in a found set in the target table (the table that receives the data). If you then delete this found set, your database will be returned to normal unless you enable the auto-enter option during import. In that case you may have some auto-entered serial numbers that have advanced to a new larger value--which shouldn't cause any problems in most cases.


          If you are importing into multiple tables, then this gets more complicated as you would need to delete the found set of any tables that have received an import and NOT from any tables that didn't.


          Life might be a lot simpler if you can re-design your system so that such imports are rarely needed. If you can simply replace your current file with the back up, for example, you wouldn't have any chance of an interrupted import.


          Another option would be to make a back up copy immediately before you import (it could be part of the same script). Then if the import is interrupted, discard the file and replace with the back up copy.