4. Windows PowerShell
The SharePoint 2010
Management Shell provides you with a more flexible and dynamic way to
perform backups and restores of your SharePoint information. Windows
PowerShell also allows you to perform several types of backups and
restores, including
Entire farm
Farm configuration only
Service applications
Web applications
Content databases
Site collections
Sites
Lists and libraries
SharePoint 2010 introduces its
own set of Windows PowerShell snap-ins to extend the core functionality
of Windows PowerShell by including SharePoint providers and SharePoint
commands.
Information technology (IT) administrators are equipped with the tools
necessary to have complete control and automation of system
administration tasks, thereby increasing their productivity. The
SharePoint 2010 Management Shell is a new command-line shell and
task-based scripting technology that includes an intuitive scripting
language specifically designed for IT administration. Windows PowerShell
for SharePoint 2010 includes numerous system administration utilities
with consistent syntax and naming conventions, as well as improved
navigation of common management data such as the registry, certificate
store, or Windows Management Instrumentation (WMI).
There are more than
300 Windows PowerShell for SharePoint cmdlets (pronounced
“command-lets”) available immediately when you install SharePoint 2010.
The SharePoint 2010 Management Shell is the recommended command-line
interface for SharePoint administration and is expected to replace
STSADM.
The Windows PowerShell
cmdlets also provide additional functionality not available in Central
Administration such as backup file compression and SQL Snapshots, which
provide the option to restore data to an earlier point in time.
Because there are so many
cmdlets to remember, you may need some help to keep track of what all of
them can do for you. Use the following steps to create a text file that
contains a list of the SharePoint-specific cmdlets.
Open the SharePoint 2010 Management Shell. Type in the following command. Get-command -noun sp* | out-file C:\SharePointCmdLets.txt
If you want additional
information on a specific SharePoint cmdlet, you can use one of the
following Windows PowerShell commands.
For example syntax on a specific cmdlet: get-help cmdletname -examples
For detailed information on a specific cmdlet: get-help cmdletname -detailed
For technical information on a specific cmdlet: get-help cmdletname -full
These commands are not case
sensitive. However, the spacing within the command and the parameters
must be precise. For instance, you cannot type a space in the parameter –full. Make sure there is no space between – and full.
|
5. STSADM
The STSADM command-line
utility also provides functionality to perform backups of the same
components as Windows PowerShell does. If you are familiar with STSADM
from SharePoint Server 2007, you can use STSADM commands until you
become familiar with Windows PowerShell. You must be a member of the
Administrators group on the local computer to execute the STSADM
command, and you have to drill down into the SharePoint Root directory
to execute the STSADM command. The SharePoint Root directory is located
at C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\14\BIN.
Note:
Alternatively, you can add the directory to the system environment variable path by following these steps.
Click
Start, point to All Programs, select Control Panel, select System And
Security, select System, and then click Advanced System Settings.
On the Advanced tab, click Environment Variables.
Under System Variables, select the variable Path and click Edit.
Add the following to the end of the Variable Value field.
;C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN
You must include the leading semicolon since the Path environment variable uses a semicolon as the delimiter between directories.
After accessing this directory or adding the directory to the Path
system variable, you can issue STSADM backup commands to perform your
backups and restores; you can also use STSADM to accomplish several
other administrative tasks for SharePoint 2010. Generally, you can
perform the same tasks using STSADM or Windows PowerShell cmdlets.
However, Windows PowerShell cmdlets are more powerful and tend to be
more efficient than STSADM commands.
You can use the STSADM
command-line tool for a few other functions that are not available in
Central Administration, including backup file compression and SQL
Snapshots, which provide the option to restore data to an earlier point
in time. Again, these functions are also available by using Windows
PowerShell cmdlets.
Note:
BEST PRACTICES
Use either the Windows PowerShell or STSADM command-line utilities for
backup and restore functions. These two options provide you with the
ability to script your backups, and then you can schedule the scripts to
run at specified times using Scheduled Tasks in Control Panel. This
eliminates the need to interactively log into the graphical interface to
perform your backups and restores.
6. SQL Server Backups
You can also have
SharePoint information backed up by your SQL Server administrators or
backup operators from within SQL Server. You may find this method useful
if you have a SQL Server database administrator (DBA) who is
responsible for all company content. Similar to performing SharePoint
backups, SQL Server backups can be performed using a graphical user
interface called SQL Server Management Studio, shown in Figure 6, or by using a Transact-SQL (T-SQL) BACKUP
DATABASE command. T-SQL backups can be scripted and scheduled to run at
specified times, similar to using Windows PowerShell and STSADM for
backups.
You have several different
options available when backing up your SharePoint information from
within SQL Server. Often only a SQL Server DBA will completely
understand these options and can leverage them to streamline your
SharePoint backups. Some of these SQL Server specific options include
Create a copy of the database without affecting the scheduled database backup
Set an expiration date for the backup
Perform a transaction log backup
Verify the integrity of the backup on completion
Create a checksum on backed-up data to verify that data has not been tampered with after being backed up