FileFormsToDatabaseUpgradeWizard

final readonly class \TYPO3\CMS\Form\Upgrades\FileFormsToDatabaseUpgradeWizard

Implements
UpgradeWizardInterface, ConfirmableInterface

Migrate file-based form definitions (YAML) to database storage.

This wizard reads all form definitions from the paths configured in persistenceManager.allowedFileMounts (deprecated since v14.2), imports them into the form_definition database table, and updates all tt_content references (FlexForm persistenceIdentifier) to point to the new database records.

After successful migration, the original YAML files are deleted from file storage to avoid duplicates.

When removing this class in v16, also remove all classes and methods tagged with @deprecated Remove in v16 along with the FileFormsToDatabaseUpgradeWizard.

Tags

since
14.2

Attributes

#[UpgradeWizard]
'formFileFormsToDatabaseMigration'

Table of Contents

Interfaces

UpgradeWizardInterface
Interface UpgradeWizardInterface
ConfirmableInterface
Use if upgrade wizard needs confirmation

Methods

__construct()  : mixed
executeUpdate()  : bool
Execute the update
getConfirmation()  : Confirmation
Return a confirmation message instance
getDescription()  : string
Return the description for this wizard
getPrerequisites()  : string[]
Returns an array of class names of Prerequisite classes
getTitle()  : string
Return the speaking name of this wizard
updateNecessary()  : bool
Is an update necessary?

Methods

__construct()

public __construct(FormDefinitionRepository $formDefinitionRepository, FormTransferService $formTransferService, LoggerInterface $logger, YamlSource $yamlSource, ResourceFactory $resourceFactory, PersistenceConfigurationService $storageConfiguration, StorageRepository $storageRepository, FormDefinitionMetadataExtractor $metadataExtractor) : mixed

Parameters

$formDefinitionRepository : FormDefinitionRepository
$formTransferService : FormTransferService
$logger : LoggerInterface
$yamlSource : YamlSource
$resourceFactory : ResourceFactory
$storageConfiguration : PersistenceConfigurationService
$storageRepository : StorageRepository
$metadataExtractor : FormDefinitionMetadataExtractor

executeUpdate()

Execute the update

public executeUpdate() : bool

Called when a wizard reports that an update is necessary

Return values

bool

getDescription()

Return the description for this wizard

public getDescription() : string

Return values

string

getPrerequisites()

Returns an array of class names of Prerequisite classes

public getPrerequisites() : string[]

This way a wizard can define dependencies like "database up-to-date" or "reference index updated"

Return values

string[]

getTitle()

Return the speaking name of this wizard

public getTitle() : string

Return values

string

updateNecessary()

Is an update necessary?

public updateNecessary() : bool

Is used to determine whether a wizard needs to be run. Check if data for migration exists.

Return values

bool
On this page