-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This page walks you through your first SPSDBMove run.
| Requirement | Notes |
|---|---|
PowerShell 7.0 or later (pwsh) |
Required — the Copy phase uses ForEach-Object -Parallel, which is not available on Windows PowerShell 5.1. |
SqlServer PowerShell module |
Install-Module SqlServer -Scope CurrentUser. The script will warn if missing. |
| Source SQL Server account | Must have BACKUP DATABASE on the databases to move (typically db_backupoperator or sysadmin). |
| Destination SQL Server account | Must have dbcreator (or sysadmin) to create restored databases. |
| Two file shares (or one) | A folder reachable by the source SQL service account for write and by the destination SQL service account for read. The script copies between them when they are different. |
| Free disk space | At least 1.5x the size of the largest content database on each share. |
git clone https://github.com/luigilink/SPSDBMove.git
cd SPSDBMoveOptionally trust the script for the session:
Unblock-File .\scripts\SPSDBMove.ps1SPSDBMove uses a fixed per-database folder layout on both backup roots:
\\sqlprod01\Backup\SPSDBMove\
|-- SP_Content_Intranet\
| `-- FULL\
| `-- SP_Content_Intranet_20260528_143012.bak
|-- SP_Content_Projects\
| `-- FULL\
| `-- SP_Content_Projects_20260528_143019.bak
The destination share mirrors that layout after the Copy phase.
SPSDBMove is driven by a JSON job file. Start from the sample:
Copy-Item .\scripts\SPSDBMove.sample.json .\scripts\my-refresh.json
notepad .\scripts\my-refresh.jsonSet at least SourceInstance, DestinationInstance, SourceBackupRoot,
DestinationBackupRoot, and the Databases array. The other keys have
sensible defaults — see Configuration for the full
schema.
Always start with -WhatIf to verify what the script will do:
.\scripts\SPSDBMove.ps1 -ConfigPath .\scripts\my-refresh.json -WhatIfRemove -WhatIf to execute for real. To run only one phase:
.\scripts\SPSDBMove.ps1 -ConfigPath .\scripts\my-refresh.json -Action BackupEach run prints timestamped lines to the console and also appends them to a log file alongside the script:
scripts\Logs\SPSDBMove.log
The Logs folder is created automatically on first run.
- Read Configuration to learn every parameter.
- Read Usage for the migration and refresh recipes.