This page describes manually importing the database of an existing Drupal application into Cloud Platform, as part of the process of manually importing the entire application. For information about other methods of importing an application, see Importing an existing application.
Synchronizing databases
If you have Drush configured for the source version of your application and your Acquia environments, you can use drush to synchronize them.
Dumping and restoring databases
To import a database using command-line tools:
- Create a dump file of your database.
- Import the dump file into your new database.
- Set up database connections.
Creating a database dump file
To export the data stored in your website’s database, create a database dump file from the command line by running either Drush or mysqldump
from your Drupal directory:
After you create the database dump file from your existing database, import the database dump file into the new database.
Importing your database dump file
To import a database dump file into your subscription on Cloud Platform:
- Connect to your Cloud Platform infrastructure with SSH.
- Upload your database backup to Cloud Platform, using commands similar to the examples provided at Downloading backups with command line tools. Be sure to alter the command to upload from your local computer to Cloud Platform.
Import your database dump file using one of the following methods:
You can now import files using Secure File Transfer Protocol (SFTP), Secure Copy (SCP), or rsync.
Variable legend
The following legend contains the values of the variables used in the previous commands.
[site]
: The name of your application on Cloud Platform.[env]
: The environment into which you are importing your database. Acceptable values aredev
(Development),test
(Staging), andprod
(Production).[db_name]
: The name of your database. Use the database name shown on the Databases page for the environment, not an environment-specific name. For example, if your sitename isexample
, your default database name will probably beexample
, and you should use that rather than an environment-specific name (such asexampledev
orexampletest
).