You are here

Moving a Drupal site

The following assumes that you are using the dget scripts for managing the site
#log into source site and go directory containing web root

dirname=putwebdirectoryhere
dbname=putdrupaldatabasenamehere
cd $dirname
dget backup $dbname
cd ..
rsync -av $dirname username@targetsite:
#optionally delete backup: rm $dirname/$dbname_*

#now log in to destination site

dirname=putwebdirectoryhere
dbname=putdrupaldatabasenamehere
cd $dirname
echo "CREATE DATABASE $dbname CHARACTER SET utf8 COLLATE utf8_unicode_ci;" | mysql -u root -p
dget restore $dbname
#optionally delete backup: rm $dbname_*

#make sure to add new site to backup and cron scripts

Topic: