I currently have a multi site drupal installation with several sites running.

One of the sub sites (not the main) I would like to duplicate on a new domain, then edit it from there to be appropriate for the new site. I'd just like to use my existing site as a starting point to start building the new one, with all the same graphics, data, content types, etc.

What's the easiest way to go about this?

Comments

parasox’s picture

Here's a step by step walkthrough of what I had to do to get what I wanted.

I was trying to duplicate an existing site in a multi site installation to have something to work from, rather than having to go through by hand with a fine toothed comb over every setting and configuration page to get the two sites similar. I didn't want to mess with the database, so I started with a fresh database and didn't have to do anything other than create a new database as you'd do with a standard drupal install.

Also note that I didn't care about any of the actual content, as I'm starting a new site. I'm sure that from the end of this I could export and import my content with no issues. I'm using the Acquia Prosper theme for this. Works the same way with Marina.

- Register domain
- Add DNS info to Linode panel
- Edit hosts file /etc/hosts

- cd /etc/apache2/sites-available
- cp oldsite.com newsite.com
- vi newsite.com (edit)
- sudo a2ensite newsite.com
- sudo /etc/init.d/apache2 reload

- cd /var/www/sites
- mkdir newsite.com
- cp default/default.settings.php newsite.com/settings.php
- cd newsite.com
- chmod 777 settings.php
- mkdir files
- chmod 777 files

- mysql -u root -p
- create database dbname;
- grant all privileges on dbname.* to user @'%' identified by 'password'
- FLUSH PRIVILEGES;

- visit newsite.com
- chmod 755 settings.php

Then I went to my acquia_prosper theme directory and copied my acquia_prosper.info to a /var/www/sites/all/themes/mynewtheme/ directory as my_new_theme.info

Edited it as such:

name = My New Theme
description = <a href="http://www.acquia.com">Acquia</a> Prosper is an elegant grid-based <a href="http://www.ubercart.org">Ubercart</a>-ready theme with point-and-click theming and an alternate color scheme. Requires the <a href="http://drupal.org/project/fusion">Fusion Core</a> base theme and the <a href="http://drupal.org/project/skinr">Skinr</a> module. Created by <a href="http://www.topnotchthemes.com">TopNotchThemes</a> and <a href="http://fusiondrupalthemes.com">Fusion Drupal Themes</a>.
base theme = acquia_prosper
core = 6.x
engine = phptemplate

Then:

cd /var/www/sites/all/themes/fusion/acquia_prosper

cp -R css/ ../../mynewtheme/
cp -R images/ ../../mynewtheme/
cp -R design_packs/ ../../mynewtheme/
cp logo.png ../../mynewtheme/

From there, set your theme to your new theme, and you have a new subtheme to work from for your second site.

Then I installed the Features module (http://drupal.org/project/features) with Drush on both sites.

I followed the general guide here: http://www.joshwaihi.com/node/4 to setup features

Basically it makes a module out of whatever settings and modules your current site has. So I laboriously ticked off every possible box, downloaded my newly created module, uploaded it, enabled it, and voila all my old modules are installed, enabled, permissions are correct, all my views, all my content types and fields, imagecache presets, everything is there. I do see I'll have to do some reconfiguration for things that Features doesn't support I suppose. However this is very close to where I need to be.

Only took an hour or two and will give me a huge head start on getting this new site up. Hope this helps someone else in the future.