john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

drupal migrate backup export download import to different web hosting

Migrating a drupal site to different hosting

(No, these instructions have nothing to do with "no downtime" or live site migration, if you need that then you need a professional.)

Theoretically you can put your site in Offline/Maintenance mode to ensure nothing new gets put in while you do the backup process (until the new one is online) but if you're in a Disaster Recovery then you might be using an older backup anyways.


FILES

  1. Download the folder with your Drupal install files (and hopefully any config files).

  2. Upload files/folder into a new subfolder in your new host's multi domain installation (e.g. public_html/migratingsiteNAME to have public_html/migratingsiteNAME/index.php)


DATABASE

  1. Database to backup, hopefully your CPANEL has a backup option that will export your databases (if you go with "Partial Backup" you can do one at a time).

  2. Otherwise you'll be using phpMyAdmin export or mysql --dump commands

Compression into .tar and .gzip (aka tar.gz) will speed download/upload but you might want 7zip to extract the .sql file...

http://kittyandbear.net/john/web-tutorials/drupal/drupal-backing-up-and-restoring.txt


CPANEL FROM THE NEW HOSTING COMPANY

Create the new database (almost the same name - except webhosts enforce unique database names by prefixing the username_databasename and I have different users...)

I've also created a test subdomain (mapped to the document root we created at #2) e.g. testmigrate

If you're migrating multiple subdomain Drupal installations like me then you'll have to re-create every subdomain (once the main domain has been added as an "addon domain").


MODIFYING THE CONFIGURATION FILES

  1. Use Filezilla -> right click -> file permissions or SSH chmod 644 on settings.php

  2. Then nano or notepad to modify: public_html/testmigrate/sites/default/settings.php with new DB username and password

Note that sometimes they use localhost, but MySQL may be on a different server

$db_url = 'mysql://HOSTUSER_DBUSER:password@localhost/HOSTUSER_DBNAME';

$db_url = 'mysql://kbdrupaluser:PASSWORD@10.6.166.225/kbdrupaluser';

  1. Set file permissions back to read only for (chmod 444) settings.php

  2. cron jobs will need to be recreated.


TROUBLESHOOTING

  1. You may also want to check your .htaccess file e.g. at the end

RewriteCond %{HTTP_REFERER} !^http://testmigrate.DOMAIN.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://testmigrate.DOMAIN.com$ [NC]

  1. http://example.com/index.php?q=admin/settings/clean-urls and disable clean urls to gain access to your new site; then you can enable clean urls in a manner that your new host supports.


  • « multiple domains with an hosting
  • jsp helloweb.jsp »

Published

Jan 9, 2011

Category

drupal

~354 words

Tags

  • backup 10
  • different 4
  • download 12
  • drupal 43
  • export 9
  • hosting 3
  • import 12
  • migrate 6
  • to 63
  • web 56