Showing posts with label sharepoint administration. Show all posts
Showing posts with label sharepoint administration. Show all posts

Tuesday, 26 November 2013

Common STSADM Commands

Stsadm is a command-line tool that provides access to the complete set of Office SharePoint Server 2007 operations. It can be used from the command line or with batch files or scripts. Stsadm must be run on the server itself and you must be a member of the local Administrators group on the server in order to use it. Stsadm is located at the following path on the drive where SharePoint Products and Technologies is installed: %COMMONPROGRAMFILES%\microsoft shared\web server extensions\12\bin.


How to use:

In command prompt, go to this directory:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

and then use either of the following commands:


Backup and Restore Site

>> to backup a site collection
                stsadm -o backup -url <site collection url> -filename <name of the backup file>

      example:  to backup sitecollection1 and save the backup file to drive C:

                stsadm -o backup -url "http://www.vpc.com/sites/sitecollection1" -filename "C:\sitecollection1.bak"


>> to restore a site collection
                stsadm -o restore -url <site collection url> -filename <name of the backup file>

      example: to restore sitecollection1 into a new site collection:

                stsadm -o restore -url "http://www.abc.com/sites/newsitecollection" -filename "C:\sitecollection1.bak"



Import and Export Subsite

>> to export a subsite
                stsadm -o export -url <subsite url> -filename <name of the backup file>

     example:
                stsadm -o export -url "http://www.vpc.com/log" -filename "C:\vpclog.bak"


>> to import a subsite
                stsadm -o import -url <subsite url> -filename <name of the backup file>

      example:
                stsadm -o import -url "http://www.abc.com/log" -filename "C:\vpclog.bak"
             


SetSiteLock

>> to lock the site collection as read-only:
                stsadm -o setsitelock -url <site collection url> -lock readonly

      example:
                stsadm -o setsitelock -url http://www.vpc.com -lock readonly


>> to unlock the site collection:
                stsadm -o setsitelock -url <site collection url> -lock none

      example:
                stsadm -o setsitelock -url http://www.vpc.com -lock none



Install / Uninstall & Activate / Deactivate Feature

>> to deactivate feature
                stsadm -o deactivatefeature -filename path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder> -url <site url> -force

      example:
                stsadm -o deactivatefeature -filename "DomainRequestTaskWFCT\Feature.xml" -url http://www.abc.com -force


>> to uninstall feature
                stsadm -o uninstallfeature -filename <path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder > -force

      example:
                stsadm -o uninstallfeature -filename "DomainRequestTaskWFCT\Feature.xml" -force


>> to install feature
                stsadm -o installfeature -filename <path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder > -force

      example:
                stsadm -o installfeature -filename "DomainRequestTaskWFCT\Feature.xml" -force


>> to activate feature
                stsadm -o activatefeature -filename path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder> -url <site url> -force

      example:
                stsadm -o activatefeature -filename "DomainRequestTaskWFCT\Feature.xml" -url http://www.abc.com -force






Monday, 7 October 2013

Provision SharePoint Central Administration

The SharePoint Central Administration site is use to do administration tasks for SharePoint Products and Technologies from a central location. You can provision and unprovision it by using the psconfig.exe command-line tool with the adminvs command. Provisioning creates a new SharePoint Central Administration Web application and an application pool running under the server farm administrator's account, whereas unprovisioning removes the SharePoint Central Administration Web application and its application pool.

Below are example commands to manage the SharePoint Central Administration web application on the local computer:

>> create new central administration (provision)

psconfig.exe -cmd adminvs -provision -port 8080 -windowsauthprovider onlyusentlm


>> delete central administration (unprovision)

psconfig.exe -cmd adminvs -unprovision


For more details on how to use psconfig.exe commands, please check this article: http://technet.microsoft.com/en-us/library/cc263093(office.12).aspx




Saturday, 5 October 2013

Restore Web Application By Using Content Database Backup

Below are the steps on how to restore a SharePoint web application by using the content database backup. (e.g. Testing2 is the name of content database backup)

  1. Go to the SharePoint central administration and create new web application with the same name & database name that you will restore.
  2. In Application Management >> Content databases, select your newly created web application and then delete the newly created content db (remove content database)
  3. In Sql Server, restore your content database backup. If there's an error saying that it's currently in use, just wait for 3 to 5 mins and then try again.
  4. In Application Management >> Content databases, add a content database. Set the database name equal to the restored content db in step 3. (for this case, it's Testing2)



Tuesday, 1 October 2013

Error - The site collection could not be restored

I encountered this error while restoring a site collection in a separate content database in another server. The complete error message is:

"The site collection could not be restored. If this problem persists, please make sure the content database are available and have sufficient free space."

Below are the steps that I've done to debug and fix the issue:

  1. I checked the size of the hard disk drives and it has sufficient free space. 
  2. I tried to restore it in another PC / server and I have restored it successfully. (That's why I wondered why this error happens only in that particular server)
  3. I checked the design of dbo.Sites table in the newly created content db and found out that there are two missing columns, namely FullUrl and UserAccountDirectoryPath. So, I added manually these columns and after that I have successfully restored the site collection in that server.

FullUrl column


UserAccountDirectoryPath column