08 June, 2012

SharePoint 2010: Backup/Restore with PowerShell Command

This article is in continuation with the backup operations thread and you can get the reference from here:
http://sharepointknowledgebase.blogspot.com/2012/06/backup-restore-in-sharepoint-2010.html

Restore Operations
Restore operations are associated with:
·         Site collection
·         Subsite
·         List and Document Libraries
Restore of the site collection
By using Powershell
Name: Restore-SPSite
Synopsis: Restores a site collection.
Syntax:  Restore-SPSite [-Identity] <String> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-ContentDatabase <SPContentDatabasePipeBind>] [-Force <SwitchParameter>] [-GradualDelete <SwitchParameter>] [-HostHeaderWebApplication <String>] [-WhatIf [<SwitchParameter>]] [<C
    ommonParameters>]
Description: The Restore-SPSite cmdlet performs a restoration of the site collection to a location specified by the Identity parameter. A content database may only contain one copy of a site collection. If a site collection is backed up and restored to a different URL location within the same Web application, an additional content database must be available to hold the restored copy of the site collection.
Example:
C:\PS>Restore-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak
This example restores a site collection from the backup file C:\Backup\site_name.bak to the site collection URL http://server_name/sites/site_name.
By using STSADM command:
For site collection restore:
    stsadm.exe -o restore
           -URL <URL>
           -filename <filename>
           [-overwrite]

How to restore the subsite
By using Powershell
Name: Import-SPWeb
Synopsis: Imports a site collection, Web application, list, or library.
Syntax: Import-SPWeb [-Identity] <SPWebPipeBind> -Path <String> [-ActivateSolutions <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-HaltOnError <SwitchParameter>] [-HaltOnWarning <SwitchParameter>] [-IncludeUserCustomAction <None | All>] [-IncludeUserSecurity <SwitchParameter>] [-NoFileCompression <SwitchParameter>] [-NoLogFile <SwitchParameter>] [-UpdateVersions <Append | Overwrite | Ignore>] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]
Description: The Import-SPWeb cmdlet imports a site collection, Web application, list, or library. The capability to import from a library is a new feature in SharePoint 2010 Products.
Example: C:\PS>Import-SPWeb http://site -Path export.cmp -UpdateVersions –Overwrite
This example imports the contents of export.cmp into a site at http://site, overwriting the versioned content on the site with the contents of the export.cmp file.
By using STSADM command:
stsadm.exe -o import
           -URL <URL to import to>
           -filename <import file name>
           [-includeusersecurity]

How to Restore the List/Document Libraries
By using Powershell
Export-SPWeb –Identity <site URL> -Path <Filename> -Includeusersecurity
If you have any queries/questions regarding the above mentioned information then please let me know. I would be more than happy to help you as well as resolves your issuesJ J
Thank you.

Method 'Post' of object 'IOWSPostData' failed SharePoint 2010

Guys, before I start writing on this error message, let me clarify that I have tested this issue in two environments:
·         SharePoint 2010 and Office 2007
·         SharePoint 2010 and Office 2010
Directly Jumping on to the troubleshooting steps, let me brief some details as how I reproduced that error message:
·         Open your SharePoint site
·         View all site content / http://SharePoint2010/sites/SPAdmin/_layouts/create.aspx  
·         Custom list section
·         Import a spreadsheet (refer the following screenshot)
·         Provide appropriate details for the Name field
·         Select an excel spreadsheet that you wants to import by means of Browse option
·         Range of cells
·         As soon as you selects the range of cells and click Ok then you will get the below mentioned error message:
Method 'Post' of object 'IOWSPostData' failed
First condition: SharePoint 2010 and Office 2007
If you are using the above combination then it’s never going to work.
Second condition: SharePoint 2010 and Office 2010
Its working perfectly without any problems, if you are facing the mentioned error message for this combination then here is the resolution for this:
·         Go to “C:\Program Files\Microsoft Office\Office14\1033”.
·         Find “EXPTOOWS.XLA” and double click on it.
·         Press “Alt+F11” to display VB code editor.
·         Select code window and find “lVer = Application.SharePointVersion(URL)”
·         Add following line “lVer = 2”.
·         Save and close the window.
·         Restart and see if it worked.
·         If not, change “lVer = 3”.
·         Restart and see if it worked.
If you have any queries/questions regarding the above mentioned information then please let me know, Thank you.

how to import a spreadsheet into sharepoint list 2010

Just like SharePoint 2007, SharePoint 2010 also provides this functionality in which we can directly import an excel spreadsheet and creates a custom list based on the number of the columns.
How to import? Here is the step by step guide for you:

·         Open your sharepoint site
·         Click on view all site content
·         Create
·         Select the List category from the left
Note: If you do not wants to follow the above mentioned steps then please make some adjustments in your site URL (like the below one)
You will be wondering as what exactly we need to do in the URL, it’s very easy
Just append _layouts/create.aspx after the site name. That’s it
·         Okay, continuing the same point


·         As soon as you click on ‘Import a spreadsheet’ then Provide the list name as per your project requirements
·         Click on Browse and select your excel file that you wants to import
·         Select the range of cells that you want to import
·         Click OK
-That’s it-Job Done J Very Easy Right J-
If you face any queries/questions regarding the above mentioned information then please let me know. I would be more than happy to help you as well as resolves your issues. Thank you.

07 June, 2012

Backup Restore in SharePoint 2010

Hello Guys, today I am going to share one of my interesting topics in SharePoint 2010. This is an important one that you have to be ‘aware of’ as it belongs to recovery model. Yes, you are absolutely right; I am talking about Backup-Restore methods in SharePoint 2010.
Microsoft SharePoint 2010 has comes up with so many enhancements and backup restore is one of them. I will try my best here to cover the backup-restore based on GUI (Graphical User Interface), STSADM and Powershell so that you will be proficient enough to work on these mentioned methods independently.
Backup Operations
Backup operations are associated with:
·         Site collection
·         Subsite
·         List and Document Libraries
How to take the backup of the site collection:
By using Central Administration
·         Open the central administration
·         Backup and Restore
·         Granular Backup
·         Perform a site collection backup
·         Select the appropriate web application and site collection from the dropdown
·         Provide the filename
·         Start backup
·         You will be redirected to _admin/sitebackuporexportstatus.aspx
·         It shows the status ‘Operation initializing’
·         It will take some time to complete the backup depending on the size of the site collection
·         As soon as the backup completed then the status will change to ‘Operation Succeeded’
·         That’s it and you are done... check the file location and you will see the backup file that you have specified in the above mentioned steps.
By using STSADM command
For site collection backup:
    stsadm.exe -o backup -URL <URL> -filename <filename> [-overwrite]
By using Powershell command
Backup-SPSite -Identity http://SharePointBackuptesting/sites/AMOL2010 -Path <Filename>
How to take the backup of the subsite
By using Central Administration
§  Open the central administration
§  Backup and restore
§  Granular backup
§  Export a site or list
§  Select the appropriate web application, site collection and subsite
§  Provide the filename
§  Select Export Security (If you want to include permissions)
§  Export Versions (by default ‘All Versions’ selected)
§  Start backup
§  You will be redirected to _admin/sitebackuporexportstatus.aspx
§  It will take some time to complete the backup depending on the size of the site collection
§  As soon as the backup completed then the status will change to ‘Operation Succeeded’
§  That’s it and you are done... check the file location and you will see the backup file that you have specified in the above mentioned steps.
By using STSADM command
stsadm.exe -o export -URL <URL to be exported> -filename <export file name>
By using Powershell command
Export-SPWeb -Identity <URL of the subsite> -Path <filename> -IncludeUserSecurity
How to take the backup of the List/Document Library
By using Central Administration
·         Open the central administration
·         Backup and restore
·         Granular backup
·         Export a site or list
·         Select the appropriate web application, site collection and List/Document Library.
·         Provide the filename
·         Select Export Security (If you want to include permissions)
·         Export Versions (by default ‘All Versions’ selected)
·         Start backup
·         You will be redirected to _admin/sitebackuporexportstatus.aspx
·         It will take some time to complete the backup depending on the size of the site collection
·         As soon as the backup completed then the status will change to ‘Operation Succeeded’
·         That’s it and you are done... check the file location and you will see the backup file that you have specified in the above mentioned steps.
By using Powershell command
Export-SPWeb –Identity <Site URL> -Path <Filename> -ItemURL “Lists/Tasks” –includeusersecurity
If you face any queries/questions regarding the above mentioned information then please let me know…I would be more than happy to help you as well as resolves your issues, Thank you.
Note: Complete Restore Operations will be posted in the next article... so stay tuned…very soon I will provide you the restore information that will be the concluding part of this recovery operations.

Examples:
Backup of the List:

PS C:\> Export-SPWeb -Identity http://itweb.contoso.com/sites/SP2010_Backup/dspace -Path C:\SP2010_Backups\documentbkps.cmp -ItemUrl "Lists/Calendar"

Additional notes:


Filename: SP2010_Backups\documentbkps.cmp

Item URL means the name of the list that you wanna backup (here the name of the list is 'Calendar')

Note: if your list name contain spaces then you need to use double quotes, otherwise the Windows PowerShell command will return errors.

Backup of the document library:
PS C:\> Export-SPWeb -Identity http://itweb.contoso.com/sites/SP2010_Backup/dspace -Path C:\SP2010_Backups\testlibbkp2s.cmp -ItemUrl test -Force

Additional notes:


Filename: SP2010_Backups\testlibbkp2s.cmp

Item URL means the name of the library that you wanna backup (here the name of the library is 'test')

For restore operations, please refer http://sharepointknowledgebase.blogspot.in/2012/06/sharepoint-2010-backuprestore-with.html 

06 June, 2012

Per-Location View option is missing in SharePoint 2010

In this article, I will describe the issue that I faced while working on Per-Location View options and troubleshooting steps that I have taken to resolve.
Brief details:
You can configure which views are available for specific locations in the site hierarchy. The locations in a site hierarchy for which you can configure the availability of views are:
·         Lists
·         Libraries
·         Folders for lists and libraries.

How to reproduce the issue?
I have created a site by using blank template. Blank site template does not have any default list/libraries created and we can design it as per our project requirements. So afterwards I have created a custom list and tried to configure the per location view settings but here is the mystery begins...As I am not able to see that option under list settings.

How to resolve this issue?
·         Open the sharepoint site in which you are facing the issue
·         Site actions
·         Site settings-site actions (don’t be confused with this repeated word)
·         Manage site features
·         Activate this feature Metadata Navigation and Filtering
·         Go back to the list settings now and check the results JJ

You can see that option is there now and I can see your smiling face J

Important guidelines about this ‘Location per View’ option

1)   You cannot use personal views for per-location views
2)   To configure per-location view settings you must have at least the permissions obtained by being added to the default Designer security group for the site that the list or library is in.

If you have any queries/questions regarding the mentioned information then please let me know. Thank you.