Quickly Backing up / migrating Drupal site !!

Here are the quick steps i use to backup and create a sand box drupal site in my project complainsindia.com, Hope it can be helpful.

Backing up site:
  • Connect your host using ssh.
  • Fire command tar -zcvf backupname_date.tar.gz <drupal-root>/
  • Download backupname_date.tar.gz to your local machine using FTP(Filezila etc).

Backing up Database: 

Restoring to new server or Creating a Sandbox site:

  • Extract backupname_date.tar.gz on server. Use the command tar -zxvf backupname_date.tar.gz.
  • Replace .htaccess from with same server copy if available or you may need to commment/Un-comment line "RewriteBase / ".
  • Update DB info in sites/default/settings.php.
  • Change permissions for sites/default/files as writable.
  • Fire up your PHPmyadmin, Create databse with same settings provided in settings.php, and import the tables
That's it short n sweet.