Over time, you may find that your production website and the local copy of your website become out of sync. You might find it necessary to create a backup of your site to place on your local machine so that you can test new development features.


To do this you will need a local server on which you can run PHP and mySQL. I recommend using MAMP, WAMP, LAMP or XAMPP.


Next you will need to make a back-up of your Drupal database. Many hosting solutions provide the ability to perform database back-ups through the control panel for your hosting account. Otherwise, you can download the Backup and Migrate module to perform a database backup through the admin interface of your website.


Download and install the version of Drupal that your website was running on. This involves unzipping the Drupal installation into the htdocs folder of your localhost server. (Typically found in the directory of your localhost server).


Start your localhost server, open the Start Page, and navigate to phpMyAdmin. Type a new name for your database, and click Create.

Create the Database in phpMyAdmin


Once the database has been created, you need to import your back-up copy of the database. Click on the Import tab and browse for the database file that you backed up in step 2. Click Go, it might take a couple of seconds to import everything. If your database is too large, you may have to import the database via a terminal command.

Import the Database in phpMyAdmin


Navigate to your local copy of Drupal that you unzipped in step 3. Make a copy of the default.settings.php file which is found in the /sites/default directory. Rename the copy settings.php.

Create a copy of settings.php


Open up settings.php, and update line 92. On a default installation of MAMP, the username and password are both root, and the database name is the name you provided in step 4. Save the file.

Edit settings.php


Download your files directory and place it in the same spot in your localhost directory.


Download your /sites/all folder to have a copy of your themes and modules.


Open a web browser and type in localhost as the address, and enjoy your fully working copy of Drupal ready for local development.