---
title: "Lesson 4: Post Code Deploy - Deploying a Drupal 9 Application"
date: "2025-02-06T01:22:43+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/94156-lesson-4-post-code-deploy-deploying-drupal-9-application"
id: "fcd14fb2-b5c8-4ca5-96d0-3d0d86c51f15"
---

This is **Lesson 4** of [Tutorial: Deploying an Application in Drupal 9](/acquia-cloud-platform/help/94606-tutorial-deploying-drupal-9-application "Tutorial: Deploying a Drupal 9 Application").  
 

**In this lesson we will:**
===========================

*   Update production database to reflect code changes

**Lesson Goal**
===============

Perform application updates after new code has been deployed.

In order to complete this lesson you will need:

*   Command line access to an Acquia Cloud Platform subscription
*   Drupal application that is deployed to Acquia Cloud Platform

**Lesson**
==========

**Configuration and database updates**
--------------------------------------

At this point, the code for your new release is on your production server(s). However, your database has not been updated in any way.

### **Database updates**

A typical code release will require the following database-related actions to be performed:

*   Update hooks provided by contributed modules should be executed. This is easily accomplished with:
    
        drush updatedb
    
*   Changes to exported configuration files should be imported. Depending on your configuration management strategy, this may require:
    
        drush config-import
    
    or
    
        drush features-revert-all
    
*   Your caches should be rebuilt. This will allow changes to Twig templates, CSS, JavaScript, and various other cached data to be registered. This can be accomplished with:
    
        drush cache-rebuild
    

Depending on the changes that your release contains, these commands may need to be run in a specific order or even multiple times. The consequences of running these commands incorrectly can be subtle and complex.

### **Acquia Cloud Hooks**

**Important**

When creating a new [Acquia Cloud CD](/node/56193) environment, the `post-code-deploy` hook is not run, and this hook must be run twice for its changes to take effect. For more information, see [this known issue](/node/56249).

Acquia Cloud Hooks provide a mechanism for executing a script when a particular action is performed. For releases, the `post-code-update` and `post-code-deploy` cloud hooks are relevant. These will allow a custom script to be executed each time that a new tag is deployed to your production environment.

To [implement a cloud hook](/node/56168), you must create an executable bash script and place it in a specific location in your codebase.  
 

  
**Congratulations, you've successfully deployed a Drupal application to a production environment following Drupal best practices!**
======================================================================================================================================