views:

502

answers:

3

i am new to sharepoint. I have few queries on sharepoint deploy ment. it would be nice of you if any one clarify me on these queries.

i have to deploy one sharepoint application/site from one server to another server. there are lot of file like .ascx(created through asp.net), .dll webparts, and workfolwsetc present in the application. how should i deploy all those files fromone server to another. this is for testing ( the other server). also there are more than 10 solution files(containing all the files) exist in the project.

i tried some thing going through different sites like using target, makecab etc but it is bit confusing for me. as there is no manifest file existing in my application and there are more than one solution files exist. do i have to write own manifest file for individual solution or one for the project or it has to be provided by the develepor? what should be the path for the feature,workflow xmls in the ddf. where to deploy the wsp file. also what is the procedure to follow for populating the site after wsp file is deployed in the server.

do i have to recreate all the sites in the destination server?

is there any free tool available which i can use for deployment? if yes then which part we can deploy: web part or workflow?

can we use NAnt for this activity?

thanks in advance.

+1  A: 

You can use stsadm to copy the content database from one server to another. This task can definitely be automated with nant (that's what we do).

Using stsadm -o backup, you can create a backup of your content and config databases. Then you restore them with stsadm -o restore. For example:

stsadm -o backup -url http://yoururl -filename prodsite.dat -overwrite

stsadm -o restore -url http://newurl -filename prodsite.dat -overwrite

I highly recommend SharePoint 2007 Administration. It can be very easy to hose a SharePoint installation if you don't know what you're doing.

Robert S.
thanks alot for the inputs. What does it mean ny content database? do all the dlls, ascx, webparts, xml files come under content database? Please clarify me.
one more query. how stsadm work with nant to copy content database. do i have to maintain any folder structure(hierarchy)? do i have to care for web.config file entries for dlls?
Content databases are stored in the SQL Server that your SharePoint connects to. It contains all the content for your SharePoint site, which you can look at in SharePoint Designer.
Robert S.
You can use NAnt to run the stsadm command. Any applications you have inside SharePoint (such as an ASP.NET application set up in IIS and called by your SharePoint app) will need to be deployed separately.
Robert S.
thanks a lot for your comments. can you please recommend any site/doc to refer for this activity?
+1  A: 

If all your files are in solutions (WSP's) then jsut roll those out to the other server. Then copy the content databases by just making a backup on the sql server of the original content database, restore it on the new environment's database server. Then recreate the web applications on the new machine, specifying the names of the content datbases to correspond with the just restored databases' names. Then deploy solutions to correct web applications.

Edit

// ADDING A WEB.CONFIG MOD

SPWebConfigModification modification = GetModification(key, value);
if (!webApp.WebConfigModifications.Contains(modification))
{
  webApp.WebConfigModifications.Add(modification);
  webApp.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();
  webApp.Update();
}

AND The GetModification method (found this on the internet a while ago)

private static SPWebConfigModification GetModification(string key, string value)
{
  if (string.IsNullOrEmpty(key))
  {
    throw new ArgumentNullException("key", "The key parameter is mandatory");
  }

  if (string.IsNullOrEmpty(value))
  {
    throw new ArgumentNullException("value", "The value parameter is mandatory");
  }

  var modification = new SPWebConfigModification
  {
    Name = String.Format(CultureInfo.InvariantCulture, @"add[@key=""{0}""]", key),
    Path = "configuration/appSettings",
    Value = String.Format(CultureInfo.InvariantCulture, @"<add key=""{0}"" value=""{1}"" />", key, value),
    Owner = Assembly.GetExecutingAssembly().FullName,
    Sequence = 0,
    Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode
  };
  return modification;
}
Colin
thanks a lot for your comments. can i create wsp's of all my files? if yes then what are files from which i have to create wsp and what is the procedure to create wsp?
Check out WSPBuilder!
walming
As Walm3864 said, WSPBuilder is the way to go, if you google for WSPBuilder you'll find it on codeplex and links to enough tutorials to go with.
Colin
thanks a lot for the info. i have created the wsp and taken the backup of the conetent databse. now i am able to deploy the solution with restore and wsp deployment manually. in this process i am not able to make changes in the web.config file. i have to make lot of changes in my web.config with entris for services, webparts and app settings. how can i automate this? can make this one time click like an installer?
You can do web.config modifications using the SPWebConfigModification class, see the edit in my answer for an example
Colin
Thanks a lot for your inputs. I have one doubt. How can I edit the web.config file of the site. can i make like an installer that will deploy the content database and the wsp file as wel as update the web.config? i have to make a lot of entries for safe control, app setting and some other places. can i automate this? How to get the web.config of the new site:port at the runtime/ installation?
A: 

How to deploy sharepoint site in another server

chandraprakashadwani