Tuesday, January 21, 2014

Visual Upgrade from SharePoint 2007 to 2010

1.    Take the Content database from Source Server
Once connected to your database server, you will need to browse to your database in the left window pane of Management Studio.
Right Click on your database, and under “Tasks” choose “Back Up…
kb-sql-backup-mgmt-studio-1
Step 2
A new window will open where we will configure where to save the database backup file.
You will want to ensure that the “Backup type” is set to “Full” to get a Full backup of your database.
Now, highlight the Destination file that is already in the list by clicking on it, and Click “Remove“.
kb-sql-backup-mgmt-studio-2
Step 3
Now, Click “Add…” to specify where to save the backup file.
kb-sql-backup-mgmt-studio-3

Step 4
A window will pop up, asking you where to save the backup file. Enter a location of your choice. For this example, we will save it to “C:\Backup\backmeup-Full-041608.bak“.
Note that this is the entire actual filepath.
kb-sql-backup-mgmt-studio-6






Step 5
Now, we have to make sure that the backup you are creating overwrites all existing backup sets, as appending it to an existing set can cause conflicts when attempting to perform a restore. On the left-hand side of the window, click on ‘Options‘, and then click on ‘Overwrite all existing backup sets‘.
kb-sql-backup-mgmt-studio-5
Step 6
Once this option is in place, all that is left to do is to run the backup! Click “OK” to begin the database backup.
kb-sql-backup-mgmt-studio-4
Step 7
If the database backed up successfully, you should receive a message as pictured below.
kb-sql-backup-mgmt-studio-7




2.    Restore Database to Target Database Server
1. Open SQL Server 2005 Management Studio.
2. Connect to the appropriate server.
3. Expand Databases.
4. Right-click the desired database, mouseover Tasks, mouseover Restore and select Database.
5. The Restore Database window will appear.
6. Ensure that the correct database name appears in the To database field. If not, select it from the dropdown.
7. Under Source for restore, select the From device radio button.
8. Click the button next to the textbox to select the device to restore from.
9. The Specify Backup window will appear.
http://blogs.tech-recipes.com/shamanstears/files/2007/02/sqlrestore.png
10. Click Add and locate and select the backup file from the Locate Backup File Window. Click OK.
11. Under Select the backup sets to restore, select all three backups (full, transaction log, and differential).
12. In the left pane, select Options.
13. Under Recovery state, ensure that the Restore with Recovery radio button is selected.
14. Click OK to begin restoring the database.
15. Once the restore is complete, a notification box will appear. Click OK to close the box. You have now restored your database to the most recent state.

3.    Use Test-SPContentdatabase to find out any issues in source server SharePoint sites
Use the Test-SPContentDatabase cmdlet to test a content database against a Web application to verify all customizations referenced within the content database are also installed in the web application. This cmdlet can be issued against a content database currently attached to the farm, or a content database that is not connected to the farm. It can be used to test content databases from SharePoint 2010 Products and from SharePoint Products and Technologies.
Ex: Test-SPContentDatabase -Name  -WebApplication  [-AssignmentCollection ] [-DatabaseCredentials ] [-ServerInstance ] [-ShowRowCounts ]

4.    Using Mount Database option to attach the content database to Target SharePoint Farm
The Mount-SPContentDatabase cmdlet attaches an existing content database to the farm. If the database being mounted requires an upgrade, this cmdlet will cause the database to be upgraded.

The default behavior of this cmdlet causes an upgrade of the schema of the database and initiates upgraded builds for all site collections within the specified content database if required. To prevent initiation of upgraded builds of site collections, use the NoB2BSiteUpgrade parameter. This cmdlet does not trigger version-to-version upgrade of any site collections.

-----------------EXAMPLE 1---------------------
Mount-SPContentDatabase “MyDatabase” -DatabaseServer "MyServer" -WebApplication http://sitename

This example mounts an existing database to the sitename web application. If upgrades are required, it triggers database schema upgrade and then performs only build-to-build upgrade actions on existing site collections if required. This operation does not changed the CompatibilityLevel for existing site collections in this database.

-----------------EXAMPLE 2---------------------
Mount-SPContentDatabase “MyDatabase” -DatabaseServer "MyServer" -WebApplication http://sitename -NoB2BSiteUpgrade
 
This example mounts an existing database to the sitename web application but it prevents any site upgrades from occurring. If upgrades are required, it triggers database schema upgrades only and no build-to-build upgrade actions are performed on any site collections. This operation does not change the CompatibilityLevel for existing site collections in this database.





5.    Using Upgrade database option to force to unlock the site collections
This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet Parameter Sets.

Use the Upgrade-SPContentDatabase cmdlet to resume a failed database upgrade or begin a build to build database upgrade against a SharePoint content database. When the Upgrade-SPContentDatabase cmdlet is run, an upgrade of an existing content database attached to the current farm is initiated. This cmdlet begins a new upgrade session, which can be used either to resume a failed version-to-version or build-to-build upgrade of a content database or to begin a build-to-build upgrade of a content database.

Upgrade-SPContentDatabase -Identity $contentdb

Details Steps as below
  • Open up the SharePoint 2010 Management Shell
  • get-spcontentdatabase
  • Copy the ID for the database that you're having problems with
  • upgrade-spcontentdatabase -id

6.    Apply New Master Pages to Migrated Site collection
To enable the look and feel choice back to enabled on every site within a site collection, use the script below. Replace SiteCollection with the actual URL for your site collection.
$SiteCollection=Get-SPsite http://SiteCollection 
foreach($SPWeb in $SiteCollection.AllWebs){$SPWeb.UIversionConfigurationEnabled=$true;$SPWeb.update();}
To enable the look and feel choice back to enabled on a single site use the following command. Replace Site with the actual URL for your site/web.

$Site=Get-SPWeb http://Site 
$Site.UIversionConfigurationEnabled=$true;$Site.update();

No comments: