Version 8 (modified by 9 years ago) ( diff ) | ,
---|
Drupal HowTo Copy site to test server
Process
- Run the Full backup script to produce a file called something like
sitebackup-YYYY-MM-DD.tgz
scp
the tar file to the new servertar -zxvf sitebackup-YYYY-MM-DD.tgz
, which will produce 2 files calleddbcontent.sql
andfilecontent.tar
- Create a directory for the web folder
mkdir /local/www/{site name}
- Copy
filecontent.tar
into the web folder - Cd into the web folder and unpack the tar file
tar -xvf filecontent.tar
- Amend the settings file in
{web folder}/sites/default/settings.php
- Change
$base_url
to the appropriate address - Change the database, username and password settings to appropriate values.
- Change
- Log into MySql
- Create the database using
CREATE DATABASE {databasename} CHARACTER SET utf8 COLLATE utf8_general_ci;
- 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}';
- This user should not be the admin user account
- Restore the contents to the database using
mysql -u {username} -p {database} < dbcontent.sql
- Change the apache config file
/local/apache2/etc/httpd.conf
- Remove the section:
DocumentRoot "/local/www/htdocs" <Directory "/local/www/htdocs"> Options None AllowOverride None Order allow,deny Allow from all </Directory>
- 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>
- Remove the section:
- Restart Apache
Note:
See TracWiki
for help on using the wiki.