Information for: DEVELOPERS   PARTNERS

Importing your codebase

Importing manually

This page describes manually importing the codebase of an existing Drupal application into Acquia Cloud using Git, 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.

To prepare and import your application’s codebase into an Acquia Cloud code repository, complete the following steps:

  1. Ensure that your existing application’s most current Drupal code docroot (the directory containing files and directories including Drupal’s index.php, /includes directory, and /modules directory) is on your local computer.

  2. Move any user-uploaded files directories (such as /files, /sites/default/files, or /sites/[sitename]/files) out of your docroot directory. There are separate instructions for importing your user-uploaded files directories. This is necessary because, on Acquia Cloud, files are stored outside of your docroot to simplify management of your repository and to guarantee their availability across multiple, redundant web nodes.

  3. Determine where you want your code repository to be located on your local computer. The local code repository will contain the new docroot for your application that is connected to the repository on Acquia Cloud.

  4. The remote Acquia Cloud code repository comes with a default docroot directory that contains a placeholder file called index.html. To remove it and commit the change back to your repository, complete the following steps:

    1. Go to the directory for the new local code repository for docroot, and then check out the current default application code repository contents to your computer.

      cd [local_repository_dir]
      git clone [code_repository]
      cd [sitename]
      git checkout master
      

      where:

      • [local_repository_dir] is the directory for the new local code repository for your application’s docroot.
      • [code_repository] is the URL of the Acquia Cloud code repository. To obtain the repository URL, select your application in the Acquia Cloud interface and click Application Info.
      • [sitename] is the name of your site on Acquia Cloud. For more information about your sitename, see the Sitename definition page.
    2. In the new local code repository for the docroot directory, remove the default website and send the changes to Acquia Cloud.

      git rm -r docroot
      git commit -m "Remove default docroot."
      git push origin master
      
  5. From the new local code repository directory, make a copy of your application’s most current docroot directory using the following command:

    $ cp -R [current_docroot] docroot
    

    where [current_docroot] is the complete path to the local location for the current docroot for your Drupal application.

  6. Commit the prepared Drupal docroot (without any /files directories) into your Acquia Cloud repository:

    git add docroot
    git commit -m "Import my docroot."
    git push origin master
    

Next step

After your codebase is ready, import your database and configure its website connection.