views:

545

answers:

2

(Actual site names have been changed)

I installed drupal on elephantboarding.com, and it is under version control.

I svn updated in landonwinters.com/elephantboarding after i svn committed the installation in megafishoil.com.

But landonwinters.com/elephantboarding looks weird, like it doesn't have the default theme set up right, it's themeless. It does have a place to log in though, and it says www.elephantboarding.com at the top.

I'm assuming it has something to do with the database... but it would sure be cool if I landonwinters.com/elephantboarding was a mirror of megafishoil.com, and if I could make changes to landonwinters.com/elephantboarding without seeing those changes in elephantboarding.com until i svn updated.

Sorry for newbness, and thanks in advance for any help!

Oh, and I do have a local server, although I don't know how to svn checkout to my own computer...

+2  A: 

Yes, it is possible - I run a drupal site at http://www.blah.net, and a development/testing one at http://dev.blah.net. They both use the same code, checked out of a shared svn repository, and they both use the same database.

This works fine for me, based on the following conditions:

The line of your settings.php that defines $base_url needs to be commented out.

The line that defines $cookie_domain needs to be replaced with a conditional on the server name, to prevent logins from going freaking crazy.:

if(preg_match('/dev/i', $_SERVER['SERVER_NAME'])) {
    $cookie_domain = 'dev.blah.net';
} else {
    $cookie_domain = 'www.blah.net';
}

While this is all fine for me, that is because my paths map exactly the same way (the drupal apps both sit on the root of the domain). I originally had www.blah.net/dev, but that broke because paths just don't work anymore.

Soo, the solution is to make sure the paths map. Do you possibly have sufficient access to implement an Apache VirtualHost on the site you want to test on? If so then you can add a virtualhost entry like this:

<VirtualHost dev.blah.net:80>
        ServerName dev.blah.net
        ServerAlias blah.net

        DirectoryIndex index.php

        #change this to the path to the drupal install
        DocumentRoot /www/htdocs/ 

        <Directory "/www/htdocs">
                ## Allow CGI and Symbolic Links
                Options +FollowSymLinks +ExecCGI

                # NOTE - The FileInfo override allows rewrites to work in htaccess files
                AllowOverride All

                Order allow,deny
                Allow from all
        </Directory>

</VirtualHost>

Another note is that while you can maintain seperate templates and physicall files without any problem, if you change the configuration through the admin panel, those settings are stored in the database, and so will take effect on all installs sharing the database. Blocks are a typical example of this problem, since they are stored on the database.

Basically you cannot have two different sets of path mappings for drupal (granted, you might be able to do some insane apache rewrites, but that would get very messy). The virtualhost answer is probably the least painful solution, providing you have sufficient access.

Kazar
Ur awesome thanks!
Silver
A: 

I had a similar problem after copying a Drupal install, including the database.

As far as the theme goes, if you used the color module, then the file needs to be recreated in your new install.

Simply go to the theme configuration page, make sure the colors are as you want them, click save configuration, and Drupal will make the correct file for the colors, and the theme will go from being completely missing to working perfectly fine.

msumme