Bug 80072 - FILESAVE: Keep Base Backup Files when deleting a table to allow for recovery
Summary: FILESAVE: Keep Base Backup Files when deleting a table to allow for recovery
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: high enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: Base-UX
  Show dependency treegraph
 
Reported: 2014-06-16 02:05 UTC by Mark Elsevier
Modified: 2017-11-05 22:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Elsevier 2014-06-16 02:05:27 UTC
Problem description: Database / Table deletion, is final with no recovery possible.

Steps to reproduce:
1. .... Create Database
2. .... Create Tables
3. .... Delete Database

Current behavior: All is lost forever including any backup files.

Expected behavior: A Back-up file is created which is not deleted and can be used to recover an accidentally deleted Database or Table.

              
Operating System: Linux (Other)
Version: 4.2.4.2 release
Comment 1 Robert Großkopf 2014-06-16 19:36:30 UTC
(In reply to comment #0)
> 
> Current behavior: All is lost forever including any backup files.

Where do you get backup files? I could only create a backup-file, when I copy the database-file and insert it on another place. This could be made also by a macro.
> 
> Expected behavior: A Back-up file is created which is not deleted and can be
> used to recover an accidentally deleted Database or Table.

This is a new feature you wish. It could be a good idea to minimize dataloss. So I set the importance to high and enhancement. The problem isn't only a problem of a specific platform and exists also in the versions of OOo before LO has been created. So I also change Version and platform.

Not a solution for every case, but a way: The following macro will create up to 5 backups in the backup-folder of LO and then will delete the oldest backup. It should be linked to the opening of the database-document:
-----------------------------
SUB Datenbankbackup
	DIM oPath AS OBJECT
	DIM oDoc AS OBJECT
	DIM sTitel AS STRING
	DIM sUrl_Ziel AS STRING
	DIM sUrl_Start AS STRING
	DIM i AS INTEGER
	DIM k AS INTEGER
	oDoc = ThisComponent
	sTitel = oDoc.Title
	sUrl_Start = oDoc.URL
	oPath = createUnoService("com.sun.star.util.PathSettings")
	FOR i = 1 TO 6
		IF NOT FileExists(oPath.Backup & "/" & i & "_" & sTitel) THEN
			IF i > 5 THEN
				FOR k = 4 TO 1 STEP -1
					IF FileDateTime(oPath.Backup & "/" & k & "_" & sTitel) <=  FileDateTime(oPath.Backup & "/" & k+1 & "_" & sTitel) THEN
						IF k = 1 THEN
							i = k
							EXIT FOR
						END IF
					ELSE
						i = k+1
						EXIT FOR
					END IF
				NEXT
			END IF
			EXIT FOR
		END IF
	NEXT
	sUrl_Ziel = oPath.Backup & "/" & i &"_" & sTitel
	FileCopy(sUrl_Start,sUrl_Ziel)
END SUB
-----------------------------
Comment 2 Alex Thurgood 2015-01-03 17:39:32 UTC Comment hidden (no-value)