Tech Tips, News and Tribal Knowledge

All the news that fits!

Cloning or Renaming a MOSS web application

Recently I was tasked with creating a training environment for new SharePoint site administrators. Since the trainer wanted to create as realistic an experience as possible, the site needed to closely match the production environment. The training session was scheduled to begin in a couple of days, so I didn’t have much time to come up with a workable solution.

I needed a method that wouldn’t require additional hardware or third party tools so I decided to try a simple export / import with stsadm. The procedure was much easier than I expected and after several test runs, I was ready to clone the site. The entire process took less than an hour (1GB data) and except for a few minor issues, I was able to create an exact replica of the production environment with a new application name.

Although this is a good method for renaming or cloning applications, I want to stress this is not a good method for building a development environment. Since all the web parts, databases and hardware are still shared with the production system, any changes to the base SharePoint environment of the clone will affect the original. A development or test environment should always remain isolated in its own farm on different hardware.

Procedure to create a duplicate MOSS instance in the same farm

  1. Verify you have a proper backup of your source application.
  2. Create a new target web application using a different name. For example; if the source application is http://sourceapp/, then create an application named http://targetapp/.
  3. Create a site collection at the root of your new target application using the same template that was used to create the source application.
    1. Note: If you are using custom templates, this template must be the same version as the source site’s template.
  4. Export the source site content and structure.
    1. stsadm –o export –url http://sourceapp/ –includeusersecurity –haltonwarning –filename c:\filename.cab
    2. You must export each sub-site separately. I.e. http://sourceapp/, then http://sourceapp/site1, etc.
  5. Deploy and activate all solutions and web parts on the newly created target web app.
  6. Take target server’s database offline at “Central Administration > Application Management > Content Databases > Manage Content Database Settings.”
  7. Import each exported cab file into the new web application.
    1. stsadm –o import –url http://targetapp/ -includeusersecurity –haltonwarning –filename c:\filename.cab
    2. Repeat for each sub-site.
  8. Put database back online.
  9. Pay particular attention to Issue #2 outlined below.

Issues you may encounter

  1. Due to small template inconsistencies, some sites may display the following page:

    Error encountered with corrupt default.aspx

    This problem can be fixed by copying the “Default.aspx” page from a working site (in the same web app) to the root of the non-working site. This is accomplished through the “Manage Content and Structure” page of the web app. You must first delete the corrupted “Default.aspx” page before copying in the “good” page.

  2. Please be aware that any links in the source app that are entered with the FQDN, will retain that FQDN when the site is exported/imported. This could allow the accidental editing of the source application’s data from the target application. The user will click the link thinking they are accessing the page on the duplicate server when they are actually redirected to the source server.

    To correct this issue, the source server should be carefully edited to replace all FQDN links with relative URLs prior to export. Go to the navigation page of the effected site and remove the leading host header. For example: change “http://targetapp.mydomain.com/site1/Default.aspx” to “/site1/Default.aspx.” This ensures the link is directed to the local site and not the original site. This issue is primarily of concern to user created links. SharePoint created links are always relative URLs.

  3. Custom header icons at the root of the sites may not be active even though they are imported into the web app. Correct this from the “Title Description and Icon” page of each effected site. Simply remove the reference to the default SharePoint icon and save.

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5 out of 5)
Loading ... Loading ...

1 Comment so far

  1. Bookmarks about Imported September 8th, 2008 5:16 am

    [...] - bookmarked by 2 members originally found by kenmck on 2008-09-05 Cloning or Renaming a MOSS web application http://www.os.com/?p=19 - bookmarked by 4 members originally found by JRStone29 on 2008-08-16 [...]

Leave a reply

Subscribe without commenting