Change record status: 
Project: 
Introduced in branch: 
11.5.x
Introduced in version: 
11.5.0
Description: 

The .profile file extension has been deprecated. Support for autoloading the .profile files will be removed in Drupal 13.

All functions in .profile files should be converted to the appropriate object-oriented replacement.
See the rector script and change records below for assistance.

Important note
hook_install_tasks and hook_install_tasks_alter do not yet have OOP replacements. If your profile implements either hook then track the progress in: https://www.drupal.org/project/drupal/issues/3623380

To simplify your conversion, set your profile's minimum version requirement to Drupal 11.3.0. (If you still support earlier versions, the CR's give information about how to handle backwards compatibility.)

Hooks and hook helper functions

All hook implementations should be moved to object-oriented classes with the appropriate attributes.
Most hooks can just use the #[Hook] attribute.

The following hooks require special treatment:

Most hook helper functions should move to a utility service or method on the hook class using it.

Other procedural functions

Other functions should be moved to services.

Some functions are generally safe to replace without BC.

Converting your profile's code with rector

A rector rule with a helpful DDEV script exists to assist with converting hooks. It will convert all hooks with the correct Implements hook_foo() documentation.

You can use https://search.tresbien.tech/ to gauge your profile's function's usage across Drupal contrib.

There is an attribute #[ExtensionFileIsConverted] that can be used to silence any deprecations once the .profile file is fully converted. This attribute is only needed if you must maintain the .profile file for backwards compatibility purposes.
Note: The attribute only disables the upcoming deprecation message, the files will all no longer be auto-loaded in Drupal 13.

Impacts: 
Site templates, recipes and distribution developers