I wrote instructions on how to do this on the old CiviCRM Wiki in around 2010 for Drupal 6 and then updated it again for Drupal 7. I just had to do it again on a Drupal 7 site and my old instructions were out of date.
The workflow for creating a copy of a Drupal/CiviCRM website with a database for the Drupal site and a database for the CiviCRM database is as follows:
1) Copy the CiviCRM data from the Live site with specific options.
2) Create a fresh empty Drupal site.
3) Copy all of the site assets (files, libraries modules) from the live site to the fresh empty Drupal site.
4) Install a clean copy of CiviCRM in the fresh empty Drupal site.
5) Copy/Import the Drupal database into the fresh empty Drupal site.
6) Import the CiviCRM data from step 1 into the fresh empty Drupal site.
Here is a step by step process of the above:
From the LIVE SITE get a full MySQL dump of the database with the following key options. You can do this with MySQLAdmin or PHPMyAdmin.
1) Do not copy the following tables:
2) Disable foreign key checks
3) Add "IF NOT EXISTS" clause under the "Add CREATE TABLE statement"
4) Add "Truncate table before insert" option
Install a fresh, blank Drupal website with the same version of the Drupal 7 that the live website uses.
After it has been installed do the following:
1) Copy /sites/default/files from the live site to the local site.
2) Copy /sites/all/libraries from the live site to the local site.
3) Copy /sites/all/themes from the live site to the local site.
4) Copy /sites/all/modules from the live site to the local site except for the civicrm module. We will use a brand new installation of CiviCRM to ensure it is clean.
Install CiviCRM in the local site
Get a fresh download of the CiviCRM version you are using on the live website. Place it in the /sites/all/modules directory and run the installer at: /sites/all/modules/civicrm/install/install.php.
After the installer runs you should have a blank Drupal 7 website and a blank copy of CiviCRM running within it. Check the Admin controls and Drupal's log messages to ensure that the installation is clean and that CiviCRM is running correctly before you proceed to import the website and CiviCRM data.
Migrate/Import the Drupal database into the local site
Migrate the Drupal database from the existing live site to the new blank local Drupal website. I use the excellent Drupal Backup and Migrate module to accomplish this but you can also do this with a MySQL Dump and import it into the site's drupal database as well.
If you are using Backup and Migrate on the Live drupal site, navigate to the Configuration -> System -> Backup and Migrate UI (/admin/config/system/backup_migrate), clear caches and download a backup of the Drupal site. On the new Local site navigate to the Configuration -> System -> Backup and Migrate -> Restore UI (/admin/config/system/backup_migrate/restore) and load the backup file that you downloaded and click restore. It may take a couple of minutes but the new local site should take on all of the Drupal features and settings of the Live site.
At this point I clear the site caches on the local site and prepare to import the CiviCRM data.
Import the CiviCRM data
Importing the CiviCRM data may be problematic. When you exported the CiviCRM database dump, you disabled foreign key checks, added a if not exists clause to the table create clause and you added the option to truncate the table data before importing data so you should be able to simply import the CiviCRM dump from the live site into your local site. I've done it with PHPMyAdmin but CiviCRM is a monster database so I like to use the terminal window with the following command:
mysql -u db_user_account -p civicrm_database_name <
Post import housekeeping
Once the Data has imported there are a few small things that need to be attended to:
1) delete the templates_c directory from the /sites/default/files/civicrm directory.
2) Clear the caches from CiviCRM, Clear the Drupal caches.
3) Make sure that your Resource URL's are correct. They will more than likely be set to the live website's resource URL settings.
4) Synchronize users to contacts
5) Go to the configuration checklist and make sure that it is correct.
6) Go to CiviCRM Admin -> System -> CMS Integration and copy any custom fields that you need to add to the /sites/default/settings.php file that are necessary for Drupal Views integration.
That should do it.