From time to time, you will need to upgrade Drupal core in your Acquia Cloud applications. This may occur when there are new Drupal core features that you want or security updates that you need.
This page describes two ways to upgrade Drupal core:
Upgrading Drupal 7 with Acquia Dev Desktop
The easiest way to upgrade Drupal 7 core for an Acquia Cloud application is to use Acquia Dev Desktop, which provides a full Drupal-specific stack that includes Apache, MySQL, and PHP. You can use Acquia Dev Desktop to develop Drupal applications locally on your computer, and then sync it with the same application on Acquia Cloud. Since it is closely integrated with Acquia Cloud, using Acquia Dev Desktop can be the easiest way to import your application into Acquia Cloud. This section assumes that you have already installed Acquia Dev Desktop and synced it with your applications on Acquia Cloud.
First, upgrade Drupal core on the local environment with Acquia Dev Desktop:
- In Acquia Dev Desktop, select the application you want to upgrade.
- Next to Local code, click the Open Drush console button.
- In the Drush console, run this command:
Drush upgrades Drupal core to the latest release.
- Next to Local site, click the URL link. Your upgraded Drupal application opens in a browser window. You can test this local copy of your upgraded Drupal application before you sync it with your Acquia Cloud Development environment.
Next, sync the local copy of your upgraded Drupal application with your Acquia Cloud Development environment:
- In Acquia Dev Desktop, select Push to Cloud Dev, and select the Code checkbox.
- Click Push code to Cloud Dev.
- Acquia Dev Desktop pushes your upgraded Drupal application to the Acquia Cloud Development environment and commits the code to the Acquia Cloud code repository.
Upgrading with Git
To upgrade Drupal 8, if you use a Git repository:
- Download the latest version of Drupal 8.
- Ensure that any upstream changes to the
docrootdirectory are pulled into your local working directory and that you have no locally modified, added, or deleted files.
If you have any locally modified, added, or deleted files, resolve any conflicts before you move on in the procedure.
- Remove the
vendordirectories. Also remove all of the files in the top-level directory, except any that you added manually.
rm -rf core vendor
rm -f *.* .*
- Extract the Drupal tar file into the
docrootdirectory inside your local checkout or clone of your Acquia Cloud repository.
tar --strip-components=1 -xzf /path/to/drupal-8.2.3.tar.gz
- Add the new files to your code repository.
git status --untracked-files=all
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
nothing added to commit but untracked files present (use "git add" to track)
git add some/new/file.inc
- Remove any files that you don't need.
git rm [filename]
- Commit your changes.
git commit -a -m "Upgrade to Drupal 8.2.3."
Note that at this point, Acquia Cloud does not deploy your changes. The commit command affects only your local working repository.
- Push your local version of the branch to the remote repository at Acquia.
http://[dev-env-URL]/update.php(replace [dev-env-URL] with the URL of your Development environment). This will update the core database tables.
- Test the upgraded application on your Development environment. Once you are satisfied, deploy your code in the Staging environment, and then to Production.
update.phpin your production environment to update the core database tables there.