Pages

Thursday, November 3, 2011

Renaming A Site Collection in Sharepoint (MOSS2007)

Renaming A Site Collection in Sharepoint

Some times we need to rename an existing site collection in our Sharepoint environment under the same Web application. Here is a way I used to rename a site collection under the same Web application on the same virtual server. Here are the Steps:

Backup the Original SiteCollection

Backup the Original Site Collection by command stsadm -o backup -url http://server/sites/originalsite -overwrite -filename %Path%\backup.dat at the command prompt.. Replace server and Originalsite as according to your environment.

Delete the Original SiteCollection

As we are restoring the site to the same virtual server and under the same Web application, we need to delete the original site because the GUIDs of SharePoint sites are stored in the contenet DB and hence are stored in the backup file.  The SharePoint content database requires that all list and siteGUIDs must be unique.  Delete the original site by typing stsadm -o deletesite -url http://server/sites/originalsite.

Restoring the Site Collection with New Name

Now we can restore the backup to it new site name by typing stsadm -o restore -url http://server/sites/newsite -filename %path%\\backup.dat (use -overwrite option too if the new site has already been created on the server) at the command prompt .  Replace server and newsite according to your environment

Nowthe old SharePoint site has been restored on a new site collection with a new name!!!!!!!!!!!!!!!!!!!!!!


Enjoy!!!!!!!!!!!!!!!!!!!

Thursday, October 13, 2011

Restoring Content DB of a Web Application from Pre-Production to Production Environment and Vise-Versa

Some time we have to restore the Content Database of a Web Application from Produciton to the same web application running on Pre_production and Vise - Versa (In order to make both the enviroments Identical).

Restoring the Content Database of a Web Application on other runnig application :

Here we will Restore the Production Content DB to Pre_production Web application ... We can do Vise versa too...

Taking the Backup of Content Database of Production Web Application:

1. Take the Backup of Content Database of web application on Pre Production server and keep it on some
     safe place.
2. Log on to the Production Database server and take the Backup of the Content Database of the Web Application that you want to restore on Pre-Production web applcation. (Content DB of a web application can be found in Central Admin --> Application Management --> Contenet Database section and selecting the rigth web application)


Restoring the Backup on the Pre Productin Database server

1. Transfer this DB backup to the Pre_Production Database server.
2. Create an empty DB in Management Studio and set the location of .MDF and .LDF files of that DB as
     per your environment  ( C:\ or D:\ )
3. Restore from backup on this newly created DB , you should change an option in the “options” tab and
    select "Overwrite DB" on the restore dialog to make it work.

Attaching the Restored DB to the Web Applicaiton

1. As the web application on Pre-Prod is already created and it has already a database attached to it. We    
   do  not need to create a new web application. We will just detach the existing DB from this Web
    application and will attach the new restored DB to it.
2. Go to Central Admin->Application Management->SharePoint Web Application Management->Content 
     Databases-> Remove Content Database from the web app. ( This step will remove the Previous or old
     DB from the application and the application is ready to get the new restored DB attached to it)

3. Now we will associate the new DB to the application :
    We will use STSADM to add restored DB to this web app
     Open the command Prompt and set the path to "C:\Program files\Common files\Microsoft Shared\Web
     Server Extentions\12\bin on new server is where you can find the STSADM.
     run this command from there.
    stsadm -o addcontentdb -url http://yourwebapp:port -databasename yourcontentdb -databaseserver   
    yoursqlserver

4. Run the IISRESET command.


It's DONE.....


ENJOY!!!!!!!!!!!!!!

Thursday, August 25, 2011

Error deleting Web site . You can't delete a site that has subssites

Error Description : When we try to delete ( From site settings wizard) a sharepoint site ( Not a site collection) which has some sub sites created under it, we get following error message :

Error deleting Web site . You can't delete a site that has subssites

Stsadm -o deleteweb command too doesn't delete such sites and throws the same error.

Solution : Try following steps from site settings to delete such sites:

  • Site Actions -> Site Settings
  • Site Administration: Content and Structure
  • In the left column, move to the parent of the main site to be deleted
  • In the right column, choose the site to be deleted (YourSite in our example)
  • Menu: Actions -> Delete
  • Deleting the selected sites will permanently delete all content and user information. All subsites in this site will also be permanently lost. Do you want to continue?: OK
Hope this will help. ;-)

Saturday, June 11, 2011

Not able to create New Site Collection in Moss 2007- Unknown Error

Issue:

Today I came across a new problem in My Moss 2007 enviornment.
When I tried to create a site collection under a Web application I received following error..

"A runtime exception was detected. Details follow. Message: The transaction log for database 'XX_DB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases.

Reason:

When I looked deep in to the issue and checked the SQL logs I found that in the SQL error logs too.. there were N number of errors saying "The transaction log for database 'SharePoint_Config' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases"

When checked the siae of LDF file of Transaction database it was more than 5 GB in comparision to 600 MB of MDF file.

So, when Transation Log file of any data base becomes full , it does not allow to perform any operation on database. And so was the case with the Sharepoint_config database , It was not allowing to perform any action on it until the LDF files is made with some free space.

It did not allow to back up the database as well as backup also requires to write some transactions in Transaction log and it was already full.

Resolution:

I performed following steps to decrease the size of  Transaction log of sharepoint_config database:

1. To be on sager side took backup of Transation log with following SQL Query:
   
   BACKUP LOG Sharepoint_Config TO DISK='D:\SP Backup\SPconfigLogBackup.bak'
   GO

 
2. Now Shrank the Transaction log file to create space on disk and make the space in Transation log file as
    well with following SQL Query

 USE SharePoint_Config
 BACKUP LOG Sharepoint_Config WITH TRUNCATE_ONLY
 DBCC SHRINKFILE (N'SharePoint_Config_log' , 200)
 GO


After issuing these two Queries, I found that the size of LDF file of sharepoint_Confing database was reduced to 200 MB and I could take the backup of database too.

Once the transation log file was emptied, I was able to create the site collection again.

Hope this will help you guys...

Thursday, March 3, 2011

Welcome to My Blog

Hello Friends,
I have come up with my new blog.
Lets make it little more interesting this time ;-)

Lalit