Is there a way to automatically save a database?

When I make modifications to a database (adding or editing records, modifying forms or reports, etc.), I understand that I need to save the whole database in addition to the saving the object I am working on. Is there a way to automatically save the whole database, either every so many minutes, or after every modification? I know that there is an autosave setting for restoration data, but I would like to be able to automatically save the main file.

Version: 6.3.3.2.0+
Build ID: libreoffice-6.3.3.2-snap1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Edited records are stored automatically, unless you are using an embedded Firebird database. This Firebird issue has been solved in version 24.8 (new versioning scheme, referring to August 2024).

The database I use most is a Firebird embedded database. I will look into changing it to a Firebird external database.

Here a way I described for Base Handbuch in German. Tried to translate through DEEPL:

An external database file can be created from an existing internal Firebird database file.
database file can be created:-

  • The temporary directory defined in LibreOffice must be searched for with the file manager file manager. A new subdirectory appears there automatically when LibreOffice is started. This subdirectory cannot be recognized by its name, but by the the time it was created.
  • The database with the internal Firebird database file must be started.
  • Click on Database → Tables to open the table container, so that the connection to the internal database file is created.
  • Several subdirectories are now created in the newly created temporary directories.
  • In addition to “firebird.fbk”, one of these subdirectories contains the created “firebird.fdb”. This file can now be copied and used as an external database file. There is no password protection for this file.
  • After closing the internal database file, the temporary directory is automatically deleted.
    automatically deleted.

If forms, queries, reports and macros have already been created, it would be a good idea to connect
old database with the new connection. This cannot be changed in the GUI.
To do this, the database file must be opened with a packing program.
and make the following change to the db:connection-data tag in the content.xml file: db:connection-data.
be made:

<db:connection-data><db:connection-resource xlink:href="sdbc:embedded:firebird"
xlink:type="simple"/><db:login db:is-password-required="false"/></db:connection-
data>

becomes

<db:connection-data><db:connection-resource
xlink:href="sdbc:firebird:file:///home/robby/Dokumente/Datenbanken/Firebird/
firebird.fdb" xlink:type="simple"/><db:login
db:is-password-required="false"/></db:connection-data>

Instead of the reference to the internal Firebird database, the reference to an external file is set here.
If an error occurs when entering the path, this can also be corrected under Edit →
Database → Properties, a different path to the database can be specified if necessary.

Without a packing program, the easiest way is to use File → New → Database → Connect to
an existing database → Firebird (external) to create a new database with the link to the external
link to the external firebird.fdb. Forms, reports, queries and macros must then be
copied from the old to the new database.

A little bit easier:

  1. Copy the FDB file to the directory of the database document and rename it to the same name as the document, for instance MyFirebird.FDB if the document is named MyFirebird.odb
  2. Run this macro against the document:
Sub switch_FirebirdConnection()
url = ThisComponent.URL
mid url, len(url)-2, 3, "FDB"
ThisComponent.DataSource.URL = "sdbc:firebird:"& url
End Sub

Test your database.
Save it if everything works.

Hello,

I have not seen any method to “automatically” save items in a Base file. You are possibly looking at multiple items beside what you mention. There can also be macros, queries, and reports plus the form(s) and then the .odb itself.

There is the Save in Tools->Options under Load/Save->General. Have found this erratic at best especially for Base.

There are a couple of macros you can run from a toolbar for saving the .odb as a backup. Don’t believe they will save your on-going work though.

One is Any other things needed in AnnotatedBackups?.

Another can be found in the LO documentation here → LibreOffice Base Handbook. See Chapter 9 Macros → Securing you database. If recalled correctly this had an easily fixed bug in the code.

Personally don’t use any. Just hit the Save icon when needed and always have backups.

I might also add there have been numerous times I didn’t want the work saved and simply scraped the work I was doing. An automated save would need the capability to be turned on & off in this case.

“I have not seen any method to “automatically” save items in a Base file.”

How about writing a “save everything” macro, which could be activated by a button on a form? It would save having to go leave the form and go back to the main window to do the save.

That may be possible but a lot of thought and planning need be done. I think it needs much more consideration in the way of saving the .odb with a timestamp in the file name and then any necessary individual items. In this manner you can go back to a specific point if things get messed up.

Hi. If you use a Firebird database file, a external file .fdb, the records will be saved automatically in this file.

How to create a Base with an external Firebird file:
https://help.libreoffice.org/latest/tg/text/sdatabase/dabawiz02firebird.html