Creating copy of Site in Multisite

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

I am planning to starting using multisite on my server and I had a quick question for the group. I have over 200 modules enabled on my exiting site, as well as various content types, etc. I will need almost all of this functionality for my new site so I am thinking of replicating my existing db into a newly named db using phpMyAdmin. Once it is running, I was thinking I could simply delete the old content (users, added content, etc) using Views Bulk Operations.

The concern I have is with uploaded images, videos, etc stored in the default/files directory. I assume that if I simply replicate the existing drupal db, then run bulk operations to delete all the content, these images, etc. will themselves be deleted from the now shared "default/files" directory, effectively destroying the original site.

This would not be an issue if I was running on a completely different server, but given that I want to do this within a multisite context, I am concerned about losing data.

Does anyone know if that is what will happen? If so, I will need to start with a new db and perhaps use the features module to import various configuration settings.

I suppose if someone did this and lost all their files, they could pull a backup of the default/files directory and simple restore it into the same location?

Thoughts? If this is a correct assumption, I'm not sure that it is documented in any of the Multisite documentation?

Comments

Copy

Fiable.biz's picture

Hello.

Your many modules should be in sites/all/modules/ (so just one version of them), except for the modules you wrote or you modified yourself and want different versions of according to the web site, and you should copy your directory sites/my_first_site to sites/my_second_site . See
https://drupal.org/documentation/install/multi-site
and its sub-pages.
You should export your database (.sql files are human readable), change its references to sites/my_first_site to references to sites/my_second_site , change the database name then import the modified database.

You'll need to change

Slovak's picture

You'll need to change sites/default (current site) to sites/first-site. Make a copy of the entire sites/default (current site) to sites/second-site.

Depending on your server and vhost file, you may be able to create redirects from sites/default to both sites/first-site and sites/second-site

You can also run SQL to replace the path in the files table in bulk for both sites. Clearing caches (especially via drush) a couple of times is helpful too.

multisite

mhamed's picture

perhaps this overflow can help about creating multisites .look at this::

https://groups.drupal.org/node/118109#comment-992668

mhamed

Multisite

Group organizers

Group notifications

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

Hot content this week