How to Add System Versioning to Existing Tables That Had Customized Versioning In Place?
15:24 16 Apr 2026

I have a MariaDB V11.8.6 with 142 tables.

Most of the tables have two additional columns; validFrom DATETIME(3) and validUntil DATETIME(3). These columns are used to track the creation time of the record (validFrom), and when the record is UPDATED or DELETED (validUntil) - NULL for the current record, a timestamp for an expired record.

Is there a way that the database can be updated to have the engine manage the system versioning, while retaining the dates stored in the validFrom and validUntil fields?

I originally thought that it would be as simple as enabling system versioning on each table, then copying the validFrom data into the system generated row_start column, and conditionally setting the validUntil into the row_end fields, but it appears that I can't set those fields with my own data.

I turned on alter_history with: SET @@system_versioning_alter_history = KEEP;

But the following SQL returns 1054 - Unknown column 'row_start' in 'SET':

UPDATE tableName SET row_start = validFrom

Any ideas?

Thanks!

mariadb