Created
April 16, 2012 21:23
-
-
Save antillas21/2401607 to your computer and use it in GitHub Desktop.
Steps to take Drupal site out of multi-site install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sites = array( | |
'sitename.com' => 'sitename.com', | |
// the first sitename.com in the file, refers to the url content in the browser's window, | |
//you may/probably should replace this with a FQDN. | |
// the second sitename.com appearing after '=>' is the directory name inside sites/ where | |
//the site files are stored. | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH into development server, cd into Drupal platform install directory and do: | |
$ drush ard sitename.com --destination=~/site-backup-filename.tar.gz | |
# Move site-backup-filename.tar.gz into the production server | |
# SSH into production server, cd into Apache document root and issue: | |
$ drush arr site-backup-filename.tar.gz --db-url=mysql://dbuser:dbuserpasswd@dbhost/dbname | |
# This will restore the sitename.com directory inside a full Drupal install taken from | |
# the development server's platform, e.g. drupal-7.10-x | |
# Change owner for the whole Drupal directory: | |
$ chown -R www-data:www-data drupal-7.10-x | |
# Just in case, also issue the same command for the following directories: | |
$ chown -R www-data:www-data sites/sitename.com/files | |
$ chown -R www-data:www-data sites/sitename.com/private | |
$ chown -R www-data:www-data sites/sitename.com/private/temp | |
# Create sites/sites.php file with the content from sites.php in this gist: | |
$ touch sites/sites.php | |
# Or you can just symlink sites/sitename.com to sites/default to emulate a clean Drupal install: | |
$ ln -s sites/sitename.com sites/default | |
# Just to be completely sure, remove anything from sites/sitename.com/settings.php | |
# that is not db related, when the site is restored, drush appends the new db settings | |
# to this file, so pretty much what's before this new db declaration is "useless". | |
# Issue several times: | |
$ drush cc all | |
# just to be sure we cleared all cache from this new install... | |
# remember to do this inside sites/sitename.com directory. | |
# in case you forgot to check permission (specially in CentOS and Enterprise built servers) | |
# remember to issue inside the Drupal install directory: | |
$ find . -type d -exec chmod 755 {} \; | |
$ find . -type f -exec chmod 644 {} \; | |
$ chown -R [apache/nobody]:[apache/nobody] . | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment