Hey guys, I have a drupal multisite installation on my PC (using xampp) that I use for development. In the sites folder, I have a folder named "triangle" which contains the site in question. I want to upload only this site to the web host as a production site. I would assume that I could start with a fresh drupal install on the server and put the "triangle" folder in the "sites" directory and delete the "default" folder. Is this correct? All of the site's contrib modules and themes are contained in the "triangle" folder. Will drupal on the server know to serve the website out of the "triangle" folder or do I have to change something to make that work?

Also, the folder with the site is named "triangle" but the domain for the server's drupal install is "uwmtriangle.org" is that going to cause any problems? I don't want to change the name of that folder, because that would mess up a lot of paths on the website (e.g. /sites/triangle/files/...).I'm used to using only the default site directory for single site installs, so I apologize if it's a dumb question.

Please let me know soon, as I hope to have the new and improved website up and running asap!

Thanks a lot!,
-Tony

Comments

amklose’s picture

bump

groenm’s picture

It is always good to familiarise yourself with the context of what you are going to do, so I advise you to read the handbook pages on multisite configurations (http://drupal.org/getting-started/6/install/multi-site). It explains how Drupal deals with the sites folder.

If you only copy the triangle folder to the production server, without copying the database, you will not get your content on the production server. If that is what you want, make sure the settings.php file points to an empty database, so Drupal will create the proper database tables. The effect of this method is basically that you already have your modules and themes installed on the disk of your production server. However, you will still have to enable and configure them in Drupal. For the rest, this method can be regarded a fresh install.

I am not sure if it is wise to delete the default folder. Drupal might complain if you are trying to access any other site accept the ones explicitely in your sites folder. However, it is fine for Drupal if you remove the default folder and replace it with a symlink to one of your other folders in the sites folder.

Drupal will not know it should serve files out of the triangle folder. You should rename it to uwmtriangle.org. If that messes up paths, you could set up a redirect in your webserver's config to deal with that. Actually, that would be a workaround. However, as long as you didn't "hardcode" any url to your files folder, I think you will be doing fine without a redirect, as Drupal itself is smart enough to generate the correct urls.

Best regards,
Mark

amklose’s picture

I forgot to mention that I would upload the database as well. I should be able to get it to connect to the database by making sure settings.php points to the new database path once it's uploaded to the server, right?

I used the multisite handbook in order to get my setup running on my computer for dev purposes, but didn't realize the importance of the site folder name until now! I should have just named it uwmtriangle.org from the beginning. However, with that, if I'm embedding an image on a page, would the URL be something like: /sites/uwmtriangle.org/files...? Or how does that work?

I guess the main question I had was if there was a way to get drupal to serve the website out of the triangle folder, without having to change the name. There are a few instances of images on pages that I posted with relative links, however they start with /sites/triangle/files... so those would get messed up if I renamed the site folder.

One page lists a bunch of files that I attached with drupal's built-in file attachments functionality. Each file says it's located at http://localhost/sites/triangle/files/..., for example. Will those automatically update if I changed the name of the site folder or will I have to re-upload them?

Thanks for your help so far!
-Tony

groenm’s picture

Yes, once the database is uploaded and the database settings are updated in settings.php, it should be fine.

If you manually entered a path to an image in a body field, or used a WYSIWYG to insert the picture, I think your path will be broken after the migration. However, I expect your CCK-filefields and CCK-imagefields to be fine. (I never tested this though.) Maybe you can use the Search and Replace module (http://drupal.org/project/scanner) to search for the /sites/triangle/files urls and replace them with the proper urls.

Mark

amklose’s picture

So after thinking about it longer, could I keep the website in it's current folder, and then create a symbolic link in the sites folder named "uwmtriangle.org" that points to the triangle folder?

If so, could that cause any foreseeable problems?

-Tony

groenm’s picture

I thought about this too. I think it also depends on your rewrite rules in the webserver. If the rewrite rules do not rewrite the urls to the files folder, you should be fine. I am not sure what the default rewrite rules for Drupal are, as I am not using Apache. I had to manually set up my rewrite rules for Drupal to work. As soon as the request is not directly served by the webserver, but passed on to Drupal, I think it will not work. So I advise you to check the rewrite rules.

Mark