8

I have a personal Drupal 6 site being hosted commercially, and I would like to maintain a mirror of the site on my local MacBook for the purposes of developing custom modules and themes before deploying them. My question has two parts:

  1. How do I set up my Mac so that it's ready to install Drupal?
  2. How do I mirror my live site locally?
2
  • Which is the version of Mac OS X running on your Mac?
    – avpaderno
    Commented Mar 12, 2011 at 21:26
  • Mac OS X 10.6.6 Snow Leopard. Commented Mar 12, 2011 at 23:40

4 Answers 4

7

First, download MAMP.

Then, use MAMP to run Drupal locally (great info here, on drupal.org). Another option is the Acquia Stack Installer, but that's only better if you plan on running Acquia Drupal (at least, in my experience). MAMP is pretty powerful (I even have it, or XAMPP on Windows) running a few Intranets here and there).

You can either grab the files using FTP, and put them in MAMP's htdocs folder (or configure MAMP better, so you can put the files into your ~/Sites/ folder, for instance, using virtual hosts), or you could use source control, like Git or SVN, to manage your drupal site codebase—then just do a git clone to your computer and you'll have the entire codebase.

Use PHPMyAdmin or some other tool to download the database for your website, and then, using MAMP's installation of PHPMyAdmin, import that database into a database on your local computer. You'll need to make sure the settings.php file for your site can authenticate to MySQL on your local computer.

You can either set up a user for your local MySQL installation with the same password and username as your live server, or you can customize settings.php so it uses a different database name and credentials on your local computer. See, for instance, Suggestions for settings.php - Local dev, Development server, Live server

1
  • Yeah, as João says, Backup and Migrate is a good/easy alternative to using PHPMyAdmin, or the command line, when getting the database for your site. Commented Mar 2, 2011 at 21:15
3

You can install MAMP on your mac in order to have Apache, MySQL and PHP and once you got Drupal installed, use FTP to access and download the following folders

  1. /sites/all/themes
  2. /sites/all/modules
  3. /sites/default

copy them to your local site. Then add the Backup and Migrate module to your production site and to your local site. Then do the following

  1. Create a backup of your production site using backup and migrate
  2. Download the backup created
  3. Go to your local site
  4. Access the backup and migrate and restore the backup

That's it.

2

I would suggest using virtualbox, and get it to mirror your virtual environment as closely as possible. While you can use MAMP, you may find that there are subtle differences which bite you over time.

You may find that your local mamp is 64 bit and php 5.3, both of which are not guaranteed in the wild and both of which can bite you if you are not expecting them.

3
  • I think virtualbox is definitely a good alternative to Windows users experiencing WAMP as being too slow. But if we assume that most production webservers are Linux or Unix based then perhaps a Mac (Unix based MacOS) is closer to the production environment, making the benefits of virtualbox on it less stark. That said, virtualbox can be used to test other Operating Systems' browsers' rendering of your site pages. Commented Jul 9, 2012 at 12:42
  • +1 -- just for the Virtual Box mention. I wouldn't disagree about the subtle differences that may occur between a local *AMP stack and a production environment but would you like to outline what these are (and if they actually have any impact)? Commented Jul 9, 2012 at 12:50
  • It's often easiest to get up and running with VirtualBox and VMs using a tool like Drupal VM or one of the other Vagrant-based solutions—it takes all the annoying setup work out of configuring the VM. Commented Jun 30, 2016 at 21:10
1

We're using Drush to keep sites in sync Dev/Staging/Production sites. Still ironing out the kinks but these two guides were invaluable to getting that rolling.

http://emspace.com.au/article/drush-aliases-primer-live-dev-syncing

http://drupal.org/node/670460

It's not as simple as using Backup and Migrate but I find once things are setup its faster to make small deploys and less prone to human error while updating.

1
  • +1 for the drush tip, syncing is a vital part of the development tool chain. Commented Jul 9, 2012 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.