This document provides an agenda and overview for a presentation on migrating databases and farm configurations using PowerShell. It discusses common scenarios for migration like backing up and restoring data between environments. It also demonstrates approaches using SQL Server Management Studio, PowerShell cmdlets, and third-party tools. The presentation includes demonstrations of backing up and restoring SQL databases, exporting and importing farm configurations, and considerations for migrations. It covers topics like restoring content databases, moving service application configurations, and potential issues to watch out for.
JMeter webinar - integration with InfluxDB and Grafana
SQL Saturday 411 - Migrating SharePoint Databases and Farm Configuration Using PowerShell
1. Migrating Databases and
Farm Configuration using
PowerShell
Anthony Obi
SQLSaturday #411 / SPSaturday Cambridge
12th September 2015
2. Common Scenarios
Common Approaches
Power Shell Demos:
Backup / Restore SQL Databases
Export / Import Configuration
Considerations / Gotcha’s
Agenda
3. Demo Environment
• SharePoint Server 2013 SP1 (+May 2015 CU)
• Single Web Application (+MySites Web App)
• Single Site Collection (+MySites)
• Managed Metadata Service Application
• User Profile Service Application
• SQL Server 2014 + SP1
• x2 SQL Instances
x2 SharePoint Servers
SQL2014
SP2013Srv1 SP2013Srv2
4. Common Requirements:
Backup -> Restore Data
Export -> Import Configuration
Synchronise Content and Configuration Between
Dev / Staging / Production SharePoint Farms
SharePoint Farm Rebuilds:
Domain Moves/Migrations
SQL Infrastructure Moves/Upgrades
Disaster Recovery (…possible option)
Common Scenarios
5. SQL
SQL Management Studio, SQL Agent Jobs
PowerShell
SQL Cmdlets, SharePoint Cmdlets (covered in demos)
SharePoint
Central Administration
3rd Party - Various available…
Common Approaches
8. 1. Run PowerShell from SQL Server:
Requires ‘Remote PowerShell’ calls to SharePoint Server
‘Remote PowerShell Access & Permissions’ must be Pre-Configured
http://blogs.technet.com/b/anneste/archive/2014/09/17/how-to-enable-remote-
powershell-for-sharepoint-2013-for-non-administrators.aspx
2. Run PowerShell from SharePoint Server:
Requires ‘SQL Server Management Objects (SMO)’ installed on SharePoint
Server
https://msdn.microsoft.com/en-us/library/hh248032%28v=sql.120%29.aspx
Any ‘FilePath Parameters’ are local to SQL Server (NOT SharePoint Server)
Approach Options
9. Post Restore Tasks
Security: Move-SPUser Cmdlet
Changed Domain Names
Changed Account Names (User accounts, NOT Service Accounts)
http://technet.microsoft.com/en-us/library/ff607729%28v=office.15%29.aspx
3rd Party Solutions
Ensure Custom Solutions / Features Deployed (.wsp/ .app)
SharePoint Infrastructure
Managed Metadata – Site Navigation, Available Term Sets etc
User Profile Service – Recreate Service Application(s), Connections etc.
Search – Update Topology, Content Sources, Crawls etc
10. Managed Metadata Service Database
https://technet.microsoft.com/en-us/library/Cc263199.aspx#databases
12. Import Gotcha’s
(Issue 1)
If the commands fails with the following
error message
“You do not have permission to use the
bulk load statement”
The Service Application Service Account
requires the ‘BULK ADMIN’ SQL Role
13. Import Gotcha’s
(Issue 2)
If the commands fails with the following error message
“Cannot bulk load because the file "<FilePath><GUID>ECMGroup.dat” could not
be opened”
Store the Exported ‘.cab’ file on a Network Share.
When SQL and SharePoint are on different servers, the
‘Import-SPMetadataWebServicePartitionData’ PowerShell command needs to
perform tasks on both the SP server *and* the SQL server, so both servers need
access to the Export file.
14. User Profile Service Application
Databases
1. Profile Database:
Used to store user profile information.
2. Synchronization Database:
Used to store configuration and staging information for synchronizing profile data
from external sources such as the Active Directory Domain Services (AD DS).
3. Social Database:
Used to store social tags and notes created by users. Each social tag and note is
associated with a profile ID.
https://technet.microsoft.com/en-us/library/Ee662538.aspx
15. User Profile Service Application
Databases
https://technet.microsoft.com/en-us/library/Cc263199.aspx#databases
17. Security / Service Accounts
Matching Domains
Matching Accounts (SIDs not UsernamePassword)
SharePoint Infrastructure
Matching SharePoint Versions - Service Pack/Patch Levels
Matching Service Applications
Matching Web Applications / IIS Configurations
Farm Infrastructure
Compatible SQL Versions - Service Pack/Patch Levels
Matching Server Names, Roles etc.
(use ‘SQL Aliases’ to perform SQL Server moves/upgrades)
3rd Party Solutions
SQL Restore Considerations / Gotcha’s
(Part 1)
18. SQL Restore Considerations / Gotcha’s
(Part 2)
SP Configuration
Database
Service Application
Databases
(Various limitations: Search, UPS,
State, Word Automation, Usage)
Service Application
Databases
(Various limitations: Search, UPS,
State, Word Automation, Usage)
SP Content Databases SP Content Databases SP Content Databases
100% Infrastructure Match
(virtualised, scripted install)
Security Match
SP Infrastructure Match
Matching SharePoint Versions
- Service Pack/Patch Levels
19. About Me
Independent SharePoint Consultant
Obilogic Ltd
Working with SharePoint since Portal Server 2001
(10 years+)
MCITP / MCTS SharePoint 2010
Blog: http://community.obilogic.co.uk
Twitter: @obilogic
Email: aobi@obilogic.co.uk
20.
21. Stick around for SWAG! (Prize drawing at 5.00 p.m)
All our volunteers and organisers do not get paid for running SPS
SQLSaturday Cambridge and do it because they believe in the power of
community (or are just plain nuts).
Please show your gratitude for making this possible by:
Giving them a hug
Shaking their hand
Saying thank you
Coming back next year
Consider getting your company to pay for a precon next year
Spreading the word
Getting involved yourself
But most of all, by enjoying the day!
Don’t forget to thank the sponsors for their support
Thank the speakers for donating their time, energy and expenses
22. Stick around for SWAG! (Prize drawing at 5.00 p.m)
SQLCloud — XBox One!!! (make sure you know how to play the Jet Set Willy vendor competition!)
SQLCloud—Dark Side Of The Moon, The Wall and Wish You Were Here
Microsoft — MCP Voucher
Data Idols — Supercar Driving Experience
Profisee — Signed MDS Book and £50 Amazon Voucher
SQLSentry — Plan Explorer PRO License
Pyramid Analytics—Coffee Machine
Effektor — Lego Big Ben
Rencore — SPCAF Professional License (valued at $2099!)
Axioworks — Amazon Fire TV and £75 Amazon Voucher
DELL — Beats by Dr Dre Headphones
Redgate — DLM Workshop
Pluralsight — Annual Plus subscriptions
All Your Base Conference — 3 x Conference Tickets
VisualSP—Annual training subscription
Loads of books and much much more!!!