First, let me state that I am new to Drupal. However my question has me really baffled and I hope that someone can point me in the right direction.

I have two Drupal sites existing already; www.site1.com and www.abc.site1.com. Both work great, where abc.site1.com is a sub-domain. Site1.com has about 60 pages of content and abc.site1.com has about 7 pages of content to reflect a sub-business group in our company.

Recently, my boss wanted to take site abc.site1.com, copy it exactly and make two new almost identical websites independent of the site1.com domain names. I performed the following steps to make this happen.
1. Registered two new sitenames; site2.com and site3.com
2. Mirrored site2.com and site3.com to www.site1.com so that I would only need one drupal install
2. Made two new databases for each; site2_drupal and site3_drupal; mysql.site2.com and mysql.site3.com
3. Copied all the contents from abc.site1.com into both site2.com and site3.com, including databases.
4. Edited Settings.php in site2.com and site3.com so that it would point correctly to the right databases
5. Typed in www.site2.com and www.site3.com in my browser and everthing looked great, with the exception of some images that were not linked correctly.
6. I started to edit content on both site2.com and site3.com to reflect the new companies, different from that of abc.site1.com, and things were being changed and updated with no problems.
7. I then tried to modify the logo, insert new ones that I created, and some of the images that did not link correctly. However, I noticed they were not being pointed to correctly, they were pointing to abc.site1.com/files directory...huh?
8. I then tried clearing the cache tables of site2_drupal and site3_drupal databases with no success. Both the main logo and linked images point to the abc.site1.com file folders where the images are stored.

Using the logo image as an example, it points as follows:
www.site2.com/sites/abc.site1.com/files/zen_classic_logo.png.

It should point to www.site2.com/files/zen_classic_logo.png. I assume that the mirror creates the www.site2.com.

My thought is that I need to incorporate symlinks, but I am not sure, and have never used these before. Has anyone else ever had a similar occurence?

I did try to change the base URL in settings.php for site2.com and site3.com, but this did nothing as well.

Any thoughts appreciated.

Thanks,

Gary

Comments

vm’s picture

check settings.php and ensure no $base_url was set from old site.
check .htaccess and ensure no rewrite was set for the old site.

gpbamb’s picture

Hello VeryMisunderstood.

Here is my $base_url setting:
# $base_url = 'http://www.example.com'; // NO trailing slash!

As you can see it is commented out. As I stated prior, I tried to change this to have the system point to the correct we address, but no luck.

In terms of the .htaccess file I was just about to write that I see nothing pointing to the old site, when I came across the following:
# Follow symbolic links in this directory.
Options +FollowSymLinks

My assumption here is that a Symlink was created that points the system to the website that exists as a subdomain of the primary website, if I understand this correctly. As I stated in my note, I am not too familiar with Symlinks, but at this point, I have to believe this could be the issue. Do I just comment this out, or do I need to create a new Symlink using PuTTY, and if so won't this screw up my site that uses this Symlink?

However, my underlying question would still remain, how come I can edit content in the new websites with no ill effects, but yet trying to access the images is a different story? One would think that if it was indeed the Symlink, then whatever change I made in changing Content would effect the subdomain's content as well from which I copied the database from.

Thanks for your thoughts. They are really appreciated.

CAZephyr’s picture

You didn't mention anything about changing anything in the site configurations. But just for the hell of it, when you look at Administer > Site configuration > File system what does it say?

gpbamb’s picture

Hello CAZephyr,

Yes, I forgot to mention that I did change my site configuration, i.e. file system, to the following (in generic terms from above):

sites/site2.com/files

It used to be sites/abc.site1.com/files.

Thanks for your comments,

Gary

gpbamb’s picture

OK...Some updates 1. I went into the database, under the files table, as well as several other tables and changed the images that had links containing abc.site1.com to site2.com (No change to the logo however) 2. I created a Symlink, however this had no effect either. I guess I am stuck and this is above my expertise. Will look to hire an expert.

hferree’s picture

Don't know if this helps at all. But I have a testing server on a web domain that I have and both work fine and separate of each other I have /root which has files for a full drupal install and I have /root/dev which also has files to a full drupal install except this setup.php connects to a different database than /root.

So you have www.example.com and www.dev.example.com.

gpbamb’s picture

I already have a site1.com and abc.site1.com (which resides under the site1.com folder as site1.com/sites/abc.site1.com), as stated. This all works great.

On the two new websites I want to create, using the same Drupal code, I want these to be independent of site1 to the external world with each having its own separate email address. Therefore, I mirrored site1.com to sites2&3.com, created new databases for sites2&3, and copied the databases into site2_drupal and site3_drupal. The location of these new drupal sites are site1.com/sites/site2.com and site1.com/sites/site3.com.

Since these domains are mirrored to site1.com, I will get site2.com/sites/site2.com/files. I tried Symlinking to reduce. But since site2.com does not exist up near the root /home/. it does not work. Also, I would be fine with an extended path anyway. My issue is that it appears that abc.site1.com always appears to get appended to the tail end with regards to the logo, such that I cannot change it, as it will only modify the logo in that particular site (abc.site1.com).

I tried to symlink from site1.com to site1.com/sites/site2.com, but this does nothing for me. So I ended up removing that symlink.

My only hunch at this point is the .htaccess file, but this is above my expertise.

I acutally thought that my problem was in the database of site2_drupal, as it is a direct copy of abc.site1_drupal. However, I have through this database twice looking for signs of links containing the phrase abc and changing accordingly. It appears to have had positive results for the general file images, but not the logo. This is where I am now stuck. I am still baffled that I can change the content with success, but cannot change the logo.

Cheers,

Gary

eotinfotech’s picture

Hi,
I belive the folder alias will solve you issues

sites/default/files - You have all the contents
map sites/site2.com/files -> sites/default/files

This point will help you to work as you will have all the files stores in the same place.

The second solution can be changing the files directory path in the file system
But it help for the new files added in the system

For all the old files you need to change the path in the dpl_files tables.

Please follow the above, and let us know your questions and feedback.

gpbamb’s picture

Hi Prachait,

With regards to your first point (folder alias): I have multiple websites with multiple logos all using the same filename; zen_classic_logo.png. So to try and store all files into one folder is not going to work in my opinion. Each site has its own database with a separate files folder. For me, trying to jam and organize 100's of images from each site into one folder would be impossible to manage.

For the second solution, I have changed the path names of all the image files and this works, as well as changing the files directory path (as stated in prior correspondance).

What I need now is just to figure out why the logo image (zen_classic_logo.png) keeps pointing back to the subdomain (abc.site1.com) from which I copied the database from to create site2.com and site3.com. I just don't understand where this is coming from.

I will try to look into this again and report back if I find something. You have given my hope to try again and find the culprit.

Thank you,

Gary

eotinfotech’s picture

Search the logo file name in dpl_variable - value (field)
you will find something

theme_narang_settings (theme name) and value section will have the path of logo file
Change that file path, as i wish your issue get solved.

Else buzz me back.

gpbamb’s picture

Dear Prachait,

First I would like to thank both you and Verymisunderstood for offering the solution to my logo problem. This is great and solves major problem #1.

Major problem #2 is half of my image files point in the sites2.com directory, which is good; while the other half point to the original location abc.site1.com, so I am still a little confused.

I used the instructions from Verymisunderstood to correct the logo issue, though I belive you may have been trying to get me there with a different twist. I feel that your methodology could help me to solve the second issue, if I can understand it correctly. I am thinking that if I know the exact image filename then I can search somewhere in Drupal to find the path name and reset; or is this only specific to logo and ico?

Thanks so very much,

Gary

gpbamb’s picture

To VeryMisunderstood and Prachait,

Thanks so much for your inputs. Logo issue resolved and Problem #2 is just to edit blocks and the ref's. I am all set. I can't thank you both enough.

Gary