This repository has been archived by the owner on Oct 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CopyDatabases.ps1
59 lines (42 loc) · 3.66 KB
/
CopyDatabases.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$Container = 'sitecore-commerce-docker_mssql_1',
[Parameter(Mandatory=$false)]
[string]$FromDatabaseFilePath = 'C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQL\DATA',
[Parameter(Mandatory=$false)]
[string]$ToDatabaseFilePath = 'databases/'
)
mkdir -Force -Path ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\SitecoreCommerce9_Global_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\SitecoreCommerce9_Global_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\SitecoreCommerce9_SharedEnvironments_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\SitecoreCommerce9_SharedEnvironments_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Core_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Core_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_ExperienceForms_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_ExperienceForms_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_MarketingAutomation_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_MarketingAutomation_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Master_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Master_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Processing.Pools_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Processing.Pools_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Processing.Tasks_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Processing.Tasks_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_ReferenceData_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_ReferenceData_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Master_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Master_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Reporting_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Reporting_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Web_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Web_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Xdb.Collection.Shard0.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Xdb.Collection.Shard0_log.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Xdb.Collection.Shard1_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Xdb.Collection.Shard1_Primary.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Xdb.Collection.ShardMapManager.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Xdb.Collection.ShardMapManager_log.ldf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Messaging_Primary.mdf ${ToDatabaseFilePath}
docker cp ${Container}:${FromDatabaseFilePath}\Sitecore_Messaging_Primary.ldf ${ToDatabaseFilePath}