Exclude/Export a site from multisite setup

Events happening in the community are now at Drupal community events on www.drupal.org.
no2e's picture

I have a multisite installation with several sites. Each site has its own database.

Now I want to exclude a site out of this multisite setup. It should become a single, standalone Drupal installation.
How is this possible? What do I have to pay attention to?

Comments

Hey dude, I think the back up

scotthoff's picture

Hey dude,

I think the back up and migrate model might be useful? Here is a link to that: http://drupal.org/project/backup_migrate

I imagine that moving the database to the new server would be one of the easier steps, I imagine you would need to make sure to recreate or make "links" so that your image and file links still point to the right directories. I imagine this would be a scary challenge.

My two cents is to watch out for the broken links. Someone else out there probably has something smarter to say.

How I do it

druderman's picture

First off, back up your files and database. Then leave the multisite alone for now and just try to move a copy of the site and see how it goes.

More or less, you make a new drupal installation starting with a copy of ALL the files of your multisite except the files for the OTHER sites (which you are not moving) which are in the 'sites' directory.
In this new drupal installation, you can copy all files from sites/mysite to sites/default. Your database doesn't need to change yet unless you've moved to another server.
At this point, you should still have all the files and modules which were referred to by your old site available to your new site.

You will need configure apache and maybe edit your .htaccess file to point to the new location for your site.

If you get the site working, you'll need to go to /admin/settings/file-system and point to the new file location.

The problem you may encounter will be references to absolute file paths which are no longer correct.
Look at the 'files' table in your database, these paths may explicitly refer to the old location. You'll need to do a SQL update to fix this.
If you've customized your theme, you may have something with a hard-coded path in it. Switch to a default theme and fix your custom theme. Adjust settings for the custom theme e.g. logo location.
If you've entered explicit internal links in your content body, you may need to do another SQL query on the 'node_revisions' table - similiarly for any CCK fields that have links. Alternately, you may export your database as SQL and do a search/replace to fix directory paths and then re-import it. Lastly, if you don't have much content, you can just edit every node by hand.

It is not hard to do, but if you first make a confident backup, and gradually get things working, you should be OK.

Thanks!

no2e's picture

Thanks, druderman :)

Instead of updating the DB manually (with SQL, which I can't …) I could use this module, if I understand it correctly (or?):
http://drupal.org/project/sitedir_migrate

In this new drupal installation, you can copy all files from sites/mysite to sites/default.

… but I could stay with the domain named folder, right? Or is there a need to use the default folder?

That looks like a great

scotthoff's picture

That looks like a great explanation!

Update file paths with SQL

no2e's picture

If you want to move the files of the /mysite folder to /default, you can fire this SQL statement to update the file paths:

http://groups.drupal.org/node/68633#comment-533034

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: