Version 7 (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
- Make any necessary changes to the Apache config
- Restart Apache
Note:
See TracWiki
for help on using the wiki.