1

I know variations of this question have already been asked here, but I could not find proper information on details for a backup procedure for a remote site. I am still new to Drupal.

Assuming a host handles multiple Drupal 7 sites under a /public_html directory, using the same MySQL installation:

/public_html/my_drupal_site_1/...
/public_html/my_drupal_site_2/...
/public_html/my_drupal_site_3/...
...

I see two situations to consider: i) Drush is not installed on the remote host, ii) Drush is installed on the remote host.

Regarding i), that is, Drush is not available:

  1. What would be the proper step-by-step procedure to backup and restore my_drupal_site_2 on the remote host from a local pc, assuming the Backup & Migrate module is installed on this site?
  2. Which part of the directory tree should be copied (eventually with FTP)?
  3. Which part should be restored?
  4. How to make sure only the part of the database for my_drupal_site_2 is backup and restored?
  5. Does one need to create a database before restoring the back up?
  6. Does one need to create an 'empty' Drupal site before restoring?

Regarding ii), that is, Drush is available, say via SSH on the remote site:

  1. What would be the proper step-by-step procedure to backup and restore my_drupal_site_2 on the remote host from a local pc, assuming the Backup & Migrate module is installed on this site?
  2. Is there a way to synchronize a local directory tree from the remote directory tree? The idea is to put this content under subversion or git for example.

At last, is there a all-in-one solution? Like a script that could do everything at once? Thanks.

1
  1. You set a path for manual and automatic backups in Backup & migrate module. You get the resulting tar.gz file using ftp to your local machine for backup. If you want to restore, from within the module you choose file to upload.

  2. For the db backup just the generated file, for the files the /my_drupal_site_1/sites/ directory

  3. See #2

  4. You can create a new profile in Backup & Migrate module and select which tables to backup (restore only restores what was backed up so you are ok there). Partial backup requires a lot of caution as to not forget necessary tables.

  5. If you are restoring to an existing site NO, if it is a migration you are after YES

  6. See #5

I think you are better of using i rather than ii, as using drush is a lot more "technical" and mistake prone.

As for you last question, yes... use Backup & Migrate to create a DB backup file on the server and then get everything using FTP. Even better use CPanel or Plesk and backup Home and mySql alltogether.

  • Ok, just to make sure I get you right for stuff not related to the database: I only need to create a tar.gz of the 'sites' directory of 'my_drupal_site_2' installation, not the whole installation, correct? And, I should only restore 'sites' in the migrated new site, correct? So, in total, I would have two .tar.gz, one for the database, one for the 'sites' directory, correct? – Jérôme Verstrynge Feb 8 '12 at 16:21
  • Yes this is correct, as long as you follow the drupal philosophy that all "not out the box" files go to the sites directory. For example you put new modules in sites/all/modules instead of /modules where core modules are kept. Also all images, themes etc are stored in sites directory. So if you get that and a backup of the DB you are good to go. PS: Your DB backup can have an extension of .sql, .zip or tar.gz depending on B&M export settings but they are all the same for B&M. – masimplo Feb 8 '12 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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