7

My question is about installing Sitecore in XP1 Scaled environment.

I installed the CM (XP1). The database for CM was created.

I would like to deploy the second CM, how can I do this? If I execute the same script, Sitecore will try to create a database, but I would like to use the database that already exists. Thanks.

2 Answers 2

5

You need to create a scwdp package that does not contain the databases. Basicly this is the same as you would do if you clean your website with every deploy and redeploy sitecore on to it.

This "package without database" can be created from the original one, by running a powershell script. Find out how to do this on my blog: http://onelittlespark.bartverdonck.be/sitecore-9-in-azure-paas-for-dummies-2/ (The series is focussed arround PaaS, but would also address your question.)

##########################################################################
#  
#  Usage: manualy extract the parameters.xml file from the original .scwdp.zip file and reference in this file.
#  Fill in the packagepath and paramfile path.
#
##########################################################################

$PackagePath = "c:\Projects\sitecore_single.scwdp.zip"
$ParamFile = "C:\Temp\parameters.xml"

##########################################################################

$PackageDestinationPath = $($PackagePath).Replace(".scwdp.zip", "-nodb.scwdp.zip")

$msdeploy = "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
$verb = "-verb:sync"
$source = "-source:package=`"$PackagePath`""
$destination = "-dest:package=`"$($PackageDestinationPath)`""
$declareParamFile = "-declareparamfile=`"$($ParamFile)`""
$skipDbFullSQL = "-skip:objectName=dbFullSql"
$skipDbDacFx = "-skip:objectName=dbDacFx"

# read parameter file
[xml]$paramfile_content = Get-Content -Path $ParamFile
$paramfile_paramnames = $paramfile_content.parameters.parameter.name
$params = ""
foreach($paramname in $paramfile_paramnames){
   $tmpvalue = "tmpvalue"
   if($paramname -eq "License Xml"){ $tmpvalue = "LicenseContent"}
   if($paramname -eq "IP Security Client IP"){ $tmpvalue = "0.0.0.0"}
   if($paramname -eq "IP Security Client IP Mask"){ $tmpvalue = "0.0.0.0"}
   $params = "$params -setParam:`"$paramname`"=`"$tmpvalue`""
}

# create new package
Invoke-Expression "& '$msdeploy' --% $verb $source $destination 
$declareParamFile $skipDbFullSQL $skipDbDacFx $params"
0
1

Deployment of databases is wired into "Install WDP" task in Sitecore Installation Framework. It cannot be removed easily without changing couple of things in OOTB package.

What you can do as quick solution:

  1. You need to specify different "SqlDbPrefix" parameter in your ps1 installation script for second CM server.

  2. Once script is finished on second CM server, change connection strings to original databases created for first CM server.

  3. Remove newly created databases on SQL Server created with prefix from step 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.