Copying a site to a local MAMP installation on a Mac

Last modified: June 7, 2009 - 23:56

Copying Drupal to a local MAMP installation OS X 10.5:

If it wasn't for this excellent post, I'd have never gotten anywhere. The following is just an alteration of the Copy a site to a local XAMPP installation article.

I'm using your_drupal in place of your Drupal install folder's name.

1. Download the entire Drupal site from your server, stick it into the Applications/MAMP/htdocs folder

2. Export the remote site's MySQL database using the remote server's phpMyAdmin. Import the database on your local computer using the local MAMP phpMyAdmin.

or, if the database is too big...

i.
export it on the remote server from the command line, with mysqldump:
mysqldump -u user -p yourdbname > yourdbname.sql
ii.
scp or ftp it to your Mac into the MAMP folder
iii.
import it with mysqlimport from the command line on your Mac:
/Applications/MAMP/Library/bin/mysql -u yourusername -p yournewdbname < ../yourdbnamedump.sql

3. Edit your sites settings.php file located in the Applications/MAMP/your_drupal/sites/local folder as follows:

i.

<?php
$db_url
= $db_url = 'mysql://root:root@localhost/yourSitesImportedDatabase';
?>

ii.

<?php
$base_url
= 'http://localhost:8888/your_drupal';
?>

4. Edit your sites php.htacess file located in your main drupal folder directory as follows

uncomment the line, eg get rid of the # symbol:
RewriteBase /drupal (replace "drupal" with the name of the folder that contains your site)

5. Open your MAMP's httpd-std.conf file located in Applications/MAMP/conf/apache/httpd-std.conf and stick the follow few lines at the bottom of the file:

Alias /drupal "Applications/MAMP/htdocs/drupal/"
<directory "Applications/MAMP/htdocs/drupal">
    AllowOverride FileInfo Limit Options Indexes
    Order allow,deny
    Allow from all
</directory>

6. wa'la

 
 

Drupal is a registered trademark of Dries Buytaert.