This site is built on Drupal 12.0.0-rc1, installed with composer create-project drupal/recommended-project:^12@rc on PHP 8.5 and MariaDB 11.4. We built it the same way as our Drupal 11 sister site, drupal11.se: configuration in config/sync, content in files that a script imports, and Docker both locally and on the server. Most of it simply worked. These are the things that did not, and what we did about them.
1. Drush is only available as a development version
Drush 13 requires Symfony 6 or 7, and Drupal 12 uses Symfony 8, so Composer refuses the combination. Only Drush's 14.x and 15.x development branches allow Symfony 8. We required drush/drush:14.x-dev. Because a development version pulls in other development packages, the project needs "minimum-stability": "dev" together with "prefer-stable": true, so that only the packages that have to be development versions are. Everything is pinned to exact commits in composer.lock.
2. Metatag needs its development branch too
Metatag's stable 2.2.7 says in its composer.json that it supports Drupal 10.3 and 11, so Composer will not install it on 12, even though its info file says 12. The 2.2.x branch allows Drupal 12, so we use drupal/metatag:2.2.x-dev, pinned in the lock file. Pathauto 1.16 and Token 1.18 install as normal stable releases.
3. The site cannot be installed from configuration with the Standard profile
We keep all configuration in config/sync and install every environment with drush site:install --existing-config. With the Standard profile, Drupal 12 refuses: a profile that has a hook_install() cannot be installed from configuration, and Standard has one. Our solution was to build the site on the Minimal profile and apply core's Standard recipe on top of it, which gives the same setup. Installing from configuration then works.
4. No Article or Basic page content types
The Standard profile has not created these content types since Drupal 11.4, and in Drupal 12 core has no recipes for them either. We create both content types in a small PHP script that runs once, when the configuration is built. After that they live in config/sync like everything else.
5. No "text with summary" field
The familiar body field with a separate summary is built on the "text with summary" field type, which is removed from core in Drupal 12 and continues as a contributed module. Rather than add a module for it, we gave both content types a plain Body field (formatted long text) and a separate Summary field (plain text). The summary is what the article cards show, and Metatag uses it for the meta description through the token [node:field_summary].
6. The front page is not the article list
After the install, the front page pointed at /admin/welcome, and the view that lists promoted content – called "Promoted content" since Drupal 11.5, and frontpage before that – was disabled. We enable the view and set the front page to /node in our configuration script.
7. The theme's blocks came from the admin theme
In the release candidate, the standard setup uses the new Default Admin theme both for the admin pages and as the default theme. When we enabled our own theme, Drupal copied that theme's blocks into it – including a login form in the content region. We removed it and placed the main menu block ourselves.
8. A sitemap without Simple XML Sitemap
Simple XML Sitemap only has a development branch for Drupal 12. A sitemap is simple enough that we wrote a small custom module instead: one route, /sitemap.xml, that lists the front page, the article list, every published article and page, and the topic pages. It uses Drupal's cache tags, so it is rebuilt as soon as content changes. When Simple XML Sitemap has a stable release for Drupal 12, we will consider switching back.
What worked without any changes
Our theme, copied from the Drupal 11 site, needed no code changes beyond its name and colours. Pathauto, Token and Metatag behaved exactly as on Drupal 11. Configuration export and import, Drush's deploy command and the page cache all work as before. The upgrade to 12.0.0 itself is next; we will write about how that goes when it is out.