Moving A Single Drupal Install from default Directory to Multi-Site Drupal Installation
Moving A Single Drupal Install from default Directory to Multi-Site Drupal Installation
Recently I decided to modify my configuration of Drupal 6. Previously, I had just one site, and I had innocently left everything in the default/ directory. This install in retrospect was easy but not an example of good planning. I later had to do some minor changes when I decided to migrate to multi-site.
When it later became clear that I wanted to host multiple sites, I had to move my 'files' directory from inside of /sites/default to /sites/central-america-forum.com. That was easy enough. I moved the settings.php file, cleaned the cache (I have devel module installed), fixed my hard-coded logo URL in my custom theme (oops) and it was running without a hitch.
except... I then realized that my modified installation hadn't properly transferred knowledge about the exact location of the images. Most images were not displaying - not Random Image block, not user thumbnails, etc.
So then I found some tips on Drupal: changing "files" directory configuration setting. No problem. I didn't even put the site in maintenance mode. I just backed up the db, fired off this sql: update files set filepath = replace (filepath, "sites/default/files", "sites/central-america-forum.com/files") ; and most images were back.
Except.. User thumbnails not showing up. So I fired up firebug for drupal (I had this module installed), and examined the queries for the user page ... eventually I realized 'duh' and just went to the database and did 'describe users' which made it clear that there was a 'pictures' field equivalent to the 'filepath' field... executed this sql update users set picture = replace (picture, "sites/default/files", "sites/central-america-forum.com/files") ; And it seems that everything is now working nicely. Of course the htaccess and robots.txt files are shared, which I might have to consider seriously in the future, but for now I think it's ok.
** NB - Update - January 1, 2010. I just received the following news about a drupal module that can help you automate this migration:
I just wanted to let you know that based on your post and experiences I've had of migrating sites in a mult-site setup I've created a module to make it much easier. I also wanted to add it to your post for other users who happen to find your blog post as I did when I was looking for an easier way to migrate.
http://drupal.org/project/sitedir_migrate
So in some ways this module was created thanks to you and your blog post!
-Andrew Riley
Recently I decided to modify my configuration of Drupal 6. Previously, I had just one site, and I had innocently left everything in the default/ directory. This install in retrospect was easy but not an example of good planning. I later had to do some minor changes when I decided to migrate to multi-site. When it later became clear that I wanted to host multiple sites, I had to move my 'files' directory from inside of /sites/default to /sites/central-america-forum.com. That was easy enough. I moved the settings.php file, cleaned the cache (I have devel module installed), fixed my hard-coded logo URL in my custom theme (oops) and it was running without a hitch. except... I then realized that my modified installation hadn't properly transferred knowledge about the exact location of the images. Most images were not displaying - not Random Image block, not user thumbnails, etc. So then I found some tips on Drupal: changing "files" directory configuration setting. No problem. I didn't even put the site in maintenance mode. I just backed up the db, fired off this sql: update files set filepath = replace (filepath, "sites/default/files", "sites/central-america-forum.com/files") ; and most images were back. Except.. User thumbnails not showing up. So I fired up firebug for drupal (I had this module installed), and examined the queries for the user page ... eventually I realized 'duh' and just went to the database and did 'describe users' which made it clear that there was a 'pictures' field equivalent to the 'filepath' field... executed this sql update users set picture = replace (picture, "sites/default/files", "sites/central-america-forum.com/files") ; And it seems that everything is now working nicely. Of course the htaccess and robots.txt files are shared, which I might have to consider seriously in the future, but for now I think it's ok. ** NB - Update - January 1, 2010. I just received the following news about a drupal module that can help you automate this migration: I just wanted to let you know that based on your post and experiences I've had of migrating sites in a mult-site setup I've created a module to make it much easier. I also wanted to add it to your post for other users who happen to find your blog post as I did when I was looking for an easier way to migrate. http://drupal.org/project/sitedir_migrate So in some ways this module was created thanks to you and your blog post! -Andrew Riley
Ways to have proper Website site optimization Ways to Increase my website traffic Why a Content Management System Is Important to Website Design America's Most Visited Attractions Why should I need SSL on my site? Bring Instant Traffic to Your Website or Blog Search engine optimisation for a proxy site part 2 Car Tuning: The Best Website To Learn Valuable Tips Customized Expert Design for Ecommerce Website Presentation How to Improve Website Revenue 5 Simple Tips To Generating More Targeted Traffic To Your Websites For Free How to setup a website How to make $3000 with Free Niche Websites Blueprint
Moving A Single Drupal Install from default Directory to Multi-Site Drupal Installation Anaheim