Managing your databases

Your Drupal website's database contains the website's content, configuration, and log information. When you import or create your website in Acquia Cloud, you have multiple environments to manage your website, with each environment having its own database. Because of this, your website can have multiple databases associated with it, depending on which environment you're working in.

You can use the Cloud > Workflow page to drag databases between your website's environments. For more information, including information about protecting the databases and files of your Prod environment by switching to Production mode, see Managing your workflow. You can use the Cloud > Databases page to add, back up, and delete databases, as well as view, restore, and delete database backups.

Adding a new database

Drupal sets up the website's primary database when you install Drupal. Your website might also require additional databases. You can create additional databases by using the Cloud interface.

  1. On the Cloud > Databases page, click Add database.

    Add a database

  2. Enter the database name, and then click Add database. This creates unique databases for each environment and adds a block for the database to the Databases page.
    • If the database is for a new website using Drupal multisite, enter the website name. Then, add the include statement from the Databases page to the settings.php file in the multisite directory (for example, docroot/sites/[sitename]/settings.php).
    • If the database is for additional content for an existing website, enter a name (for example, for a postal code database, use "postalcodes"), and use db_set_active('[Database]') within Drupal to access it. Do not add the include statement from the Databases page to the settings.php file unless you intend the new database to be your website's default Drupal database.

Running a large number of databases on the same website can adversely affect the performance of the database servers or the usability of the Acquia Cloud user interface. For more information, see How many databases can my Acquia Cloud site have?

Configuring your website to use environment databases

On the Cloud > Databases page, click Configure settings.php to display the include statement (sometimes called the require statement) for your database. The include statement should be at the end of the settings.php file in your /sites directory, but should precede any other Acquia Cloud-specific entries in settings.php, including Memcached configuration code or any code that uses Acquia Cloud environment variables.

Database include statement

The database include statement causes your website to use a unique database for each environment. This allows you to use the same settings.php file in each of your Acquia Cloud environments.

When you use the Cloud > Workflow page to install a Drupal distribution or import a site archive, or import a website using the Acquia Connector, Acquia Cloud creates the database include statement in your settings.php file. Otherwise, you need to edit the settings.php file yourself to add the include statement. Do not add the include statement unless you intend the new database to be your website's default Drupal database.

Moving a database across environments

  1. Open the Workflow page at Cloud > Workflow.
  2. Drag the source database container to the target environment that you want to contain the database copy.
  3. Click Copy. The database migration begins.

The Task log section of the Workflow page displays the database migration progress.

Viewing database credentials

On the Cloud > Databases page, click Database credentials.

View database credentials

The server URL, database name, user name, and password for the database in that environment are listed.

Backing up your database

The Cloud > Databases page displays the date and time of the last created backup for each database in each environment. You can also create on-demand backups and view, download, restore, and delete backups. For more information, see Backing up your site.

Deleting a database

To delete a database, complete the following steps:

  1. On the Cloud > Databases page, find the database you want to delete and click Delete, next to Configure settings.php button.

    Delete a database

  2. In the confirmation dialog, click Delete.

The database is deleted from each of your website's environments.

Monitoring and accessing your databases

Acquia Cloud provides several tools that you can use to monitor and access your website's databases:

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
By submitting this form, you accept the Mollom privacy policy.

Contact supportStill need assistance? Contact Acquia Support