Import a Drupal Website from a Server and run it locally on an Acquia Drupal AMP Stack

It is possible that you have created and edited a Drupal website on a server and now find that you want to work on this Drupal installation locally instead to speed up development time. To do this you need to import the Core Drupal website to your local Acquia Drupal AMP stack and make some local modifications. Here are the step by step instructions:

  1. FTP the entire Drupal folder from the server down to a local directory on your computer.
  2. Export the Drupal database from the server to your local computer.
  3. On the Acquia Dev Desktop Control Panel, select the ‘Localhost’ dropdown menu and choose ‘more’.
  4. Click the ‘Import’ button and fill in the details as in the following screenshot.
    • Set the ‘site path’ folder to the location where the source code resides (see Step 1.)
    • Select the ‘I have a MySql database dump file for my site’ radio button and give the database a new name.
    • Choose a local server name to run your core Drupal installation from. Note that it is not possible to use ‘localhost’.
    Web-Design-Import-Site

    Import Site Settings


  5. After clicking the ‘Import’ button, the code and database are imported to the local Acquia Drupal AMP Stack.
  6. If you have multiple setting.php files (i.e. one under the ‘sites/default’ folder and one under the ‘sites/’ folder), to aid troubleshooting you can remove one of these. In this case, I have removed the settings.php under the ‘sites/’ folder.Web-Design-One-Settings[/caption]

  7. The Core Drupal settings.php file you have imported may be structured differently to the Acquia AMP settings.php. You can standardise it by making a couple of modifications:
    • Remove the contents of $databases = array ();
    • Web-Design-Settings-Mod1

      Remove Contents of $databases Array



    • Remove the salt string also.
    • Web-Design-Settings-Mod2

      Remove Contents of Salt String


  8. Add the following code and note that when you try to run the website locally an error occurs:
  9. Web-Design-Settings-Mod3

    Error


  10. A closer investigation of the imported database reveals the problem. The database table prefix ‘dr_’ has been imported to the local database from the server and the Acquia Drupal AMP stack was not expecting this.
  11. Web-Design-Settings-Mod4

    Database


  12. To remedy the problem, add the table prefix ‘dr_’ to the settings.php. Once this has been added the imported website runs locally.
  13. Web-Design-Settings-Mod5

    Table Prefix


  14. The bottom of the settings.php should now look like the right hand side of the following snapshot:
  15. Web-Design-Settings-Mod6

    Bottom of settings.php File

Related Posts:

Enter Your Mail Address

3 replies
  1. Flingan
    Flingan says:

    Hi! Good guide, but I still got problems, got a new error trying to click “go to” in Acquia web dev” now code in lock.inc can’t find tables. It looking for tables without the dl_ – prefix . It is sort of Catch 22. And it’s more than one inc file that complains. Strange!

    Any remedy or hint?! Best/ Niklas

Trackbacks & Pingbacks

  1. […] Import a Drupal Website from a Server and run it locally on an Acquia Drupal AMP Stack    Install Core Drupal on Acquia DAMP stack […]

  2. […] Import a Drupal Website from a Server and run it locally on an Acquia Drupal AMP Stack […]

Comments are closed.