Moving Drupal

[UPDATE 11-Nov-2011] If you are doing this fairly often then rather than do this manually I highly recommend using the command line backup and restore functions that come with Drupal Drush. ================================ The official notes: http://drupal.org/node/135206 My Notes: Adding to the plethora of articles about moving a drupal site are my tips: To move a site do this on the site you are going to move: 1) Turn off clean urls Note: I moved a Drupal 6.14 site recently and skipped this step and it worked, not sure what's changed, I'm sure you used to have to do this to avoid problems. Maybe I have improved step 2 to clear the potential problems. 2) Clean up the database When exporting/backing up tick the box in the export that says drop tables. Also before you backup up clear the caches using the truncate commands below, check you might have more cache_* tables, clear them all. You can do this after restore if it is a running site, but doing it before the export will reduce the size of the export file. There may be more you could/should clear depending on which modules you have installed. (May throw error if you don't have that module. Just remove those and run it again until it runs.) truncate table cache; truncate table cache_block; truncate table cache_content; truncate table cache_filter; truncate table cache_form; truncate table cache_menu; truncate table cache_page; truncate table cache_rules; truncate table cache_update; truncate table cache_views; truncate table cache_views_data; truncate table sessions; truncate table watchdog; 3) Backup the database Command line is fastest, but for small sites you can use phpmyadmin or whatever. Tips for using phpmyadmin: Export tables only and tick "Add Drop Table" Use gzip rather than zip if you store BLOBs (E.g. embedded PHP) Now on the site you are going to restore: 4) Restore database Tip: If you didn't tick "Add Drop Table" above then delete all tables using phpmyadmin. Might be worth doing anyway to clean up any potentially old unused tables. 5) Update sites/default/settings.php (If you need to) 6) Clear the browser cache. 7) Clear browser history (ALL HISTORY) 8) CLOSE BROWSER, CLOSE BROWSER, CLOSE BROWSER 9) Try to login: http://sitename/?q=user 10) If you get access denied, repeat 6 and 7. If you still get access denied try a different browser. Seriously this is most likely a cache issue. 11) Enable clean urls: http://drupal.org/node/15365 Tip: $ sudo a2enmod rewrite $ sudo /etc/init.d/apache2 restart Try not to get distracted with all the blogs about .htaccess rewrite rules because it is unlikely to be the problem. http://drupal.org/node/15365 Another note about .htaccess, see my blog entry about configuring access on a VPS if you want to know a bit more about .htaccess files and how they could be related to drupal directory access issues. Basically if you're not sure if this is an issue try renaming the .htaccess file to remove possible restrictions. http://www.clearlysecure.com.au/node/38 If you are building a development environment you will want to check this link: http://drupal.org/node/15365 If you see a some strange messages such as this: "Fatal error: Call to undefined function system_region_list" It could be because you have not added www-data to the group you have assigned to all your drupal files. http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/ Basically I had all my files under the user and group of development but www-data was not a member of that group.

Comments

Popular posts from this blog

PHP timezones explained

iPhone Internet Tethering settings