wiki:Drupal HowTo Copy site to test server

Drupal HowTo Copy site to test server

Tags: Drupal HowTo

Process

  1. Run the Full backup script to produce a file called something like sitebackup-YYYY-MM-DD.tgz
  2. scp the tar file to the new server
  3. tar -zxvf sitebackup-YYYY-MM-DD.tgz, which will produce 2 files called dbcontent.sql and filecontent.tar
  4. Create a directory for the web folder mkdir /local/www/{site name}
  5. Copy filecontent.tar into the web folder
  6. Cd into the web folder and unpack the tar file tar -xvf filecontent.tar
  7. Amend the settings file in {web folder}/sites/default/settings.php
    1. Change $base_url to the appropriate address
    2. Change the database, username and password settings to appropriate values.
  8. Log into MySql
  9. Create the database using CREATE DATABASE {databasename} CHARACTER SET utf8 COLLATE utf8_general_ci;
  10. Grant the user permissions to the database using GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON {databasename}.* TO '{username}'@'localhost' IDENTIFIED BY '{password}';
  11. This user should not be the admin user account
  12. Restore the contents to the database using mysql -u {username} -p {database} < dbcontent.sql
  13. Change the apache config file /local/apache2/etc/httpd.conf
    1. Remove the section:
      DocumentRoot "/local/www/htdocs"
      <Directory "/local/www/htdocs">
              Options None
              AllowOverride None
              Order allow,deny
              Allow from all
      </Directory>
      
    2. And replace it with:
      DocumentRoot "/local/www/{site name}/"
      <Directory "/local/www/{site name}">
              Options FollowSymLinks Indexes
              AllowOverride None
              Order allow,deny
              Allow from all
              Include /local/www/{site name}/.htaccess
      </Directory>
      
  14. Restart Apache

Error: Macro BackLinks(None) failed
'Environment' object has no attribute 'get_db_cnx'

Last modified 8 years ago Last modified on 11/25/15 15:15:43
Note: See TracWiki for help on using the wiki.