Sunday, May 20, 2007

Changing the URL of a SharePoint Site Collection

Noticed that a site collection had a poor URL - to change the URL, backup the site and then restore using stsadm command-line operations:

To backUp:
stsadm -o backup -url {existing site collection URL} -filename {name of file}

To restore:
stsadm -o restore -url {new site collection url} -filename {name of file}

Thanks to Jose Barreto for saving me the task of rebuilding the collection from scratch


ittec said...

This was a great approach, however, when I tried it, it did not complete. I received the message, "No content databases are available for this operions. Create a content database."

There is a content database and I do not have any limits on it in terms of how many sites can be created against it. Any suggestions? said...

Here are a couple of articles for you to read about that message:

Hope that helps!

Rob said...

OMG, thanks so much. I have been doing SharePoing for a year now but never tried this process. Before I was doing site export/import to handle URL changes. I just tried this and it worked! Much easier.

Morten Haahr said...

yeah great post. What is the equaliant powershell command for sharepoint 2010?

Thee Punk Rock Chef said...

OK, you saved my life--I had my hand on the phone to call MS. We were trying to upgrade a site (content db) from MOSS 2007 to SP 2010. The original site was hosted outside our org and we imported onto one of our servers. For some reason when we upgraded the db to 2010 (which gave us success) the site collection path was the url of the old outside host and we could not access the site. After about a week of trying to fix this, we tried this method--using the outside url in the commnad for the backup and then the correct internal url for restore, and it worked. Thanks a million.