Tuesday, December 30, 2008

How Rename a SharePoint 2007 Site with STSADM

Unfortunately, there is no option to right-click and rename a site but the STSADM utility makes the process quite painless.

There are a number of ways to do this, but if we want performing a full rename (making the site identical – same name, same content, etc) we will need to use the STSADM tool.


On our front end web server, open a command prompt.
Type cd %systemdrive%\program files\common files\microsoft shared\web server extensions\60\bin
Perform the backup by typing stsadm –o backup –url http://server/sites/site1 -overwrite -filename %systemdrive%\backup.dat
If we are planning on restoring the site to the same virtual server (the same content database) we will now need to delete the original site. We need to do this due to the following:

About GUIDs and Restoring Site Collections If we attempt to restore a backup of a site collection more than once to the same content database, we may get the following error message: “No content databases are available for restoring this site collection. Create a new content database and then try the restore operation again.” This is because the globally-unique identifiers (GUID) for lists are preserved in the backup file and reused during restore, but the content database requires list GUIDs to be unique. Therefore, we cannot restore a site collection twice to the same content database, and must instead use a different content database.

Now that we have that sorted out, we can perform this optional step (we would generally want to do this)
To remove the original site type stsadm –o deletesite –url http://server/sites/site1
Now we are ready to restore to our new site name, type the following in the command prompt
stsadm –o restore –url http://server/sites/site2 -filename %systemdrive%\backup.dat
We have now successfully restored the original site into a new site collection, with a new name.

No comments: