Sign up for latest news and special reports!

* = required field

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

    Only One settings.php File



  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

Related posts:

  1. Install Core Drupal on Acquia DAMP stack
  2. Modify local Drupal site on Acquia AMP stack for upload to Server

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

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

CommentLuv badge