Update Drupal 9 core via composer on your local environment
- Open the terminal app (or the terminal in VS Code) and change to the root site directory of the site you are updating
cd [path/to/site/root/directory]
- Switch to the main branch and fetch the latest changes
git checkout master
git fetch --all
git pull
- Create a new branch from the main branch for the Drupal core update
git checkout -b update/core-[version]
- Update Drupal core (use the php that comes with XAMPP)
composer update "drupal/core-*" --with-dependencies
- IMPORTANT! Check the release page if there has been changes made to the .htaccess file. Since most sites are customized, discard the changes to retain the current changes
git checkout web/.htaccess
- Open your browser and login to the Drupal admin dashboard.
URL: https://www.yoursite.com/user
- Navigate to yoursite.com/update.php and press the continue button
URL: https://www.yoursite.com/update.php
- IMPORTANT! Check if there are database update. If there are database updates, make sure to backup the database first!
- Click the link to go back to the Administration pages and navigate to Report -> Status report page and make sure the site has updated correctly.
- Add and commit the changes and included a message with "Updated to [version]"
git add .
git commit -m "Updated Drupal core to [version]"
- Switch back to the master branch and merge the update branch to the main branch and push it to the repository.
git checkout master
git merge update/core-[version]
git push
Recent content
3 months 3 weeks ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year 7 months ago
Add new comment