---
schema_version: "1"
id: ed0acc2d6713e146fe5cd6a847141d9cb5b81293c7dc2f897616f45a494f3d4f
title: "예: 마이그레이션 계획 스크립트 작성"
collection: tableau
version: current
locale: ko-kr
portal_url: https://docs.salesforce.com/tableau/current/ko-kr/online/cmt-scripting_migration_example.md
canonical_url: https://help.tableau.com/current/online/ko-kr/cmt-scripting_migration_example.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 105eec55107ab3dea981e4d243e461d887d612978afd286384709a2cea658654
description: Sample script for scripting a multi-plan migration with the Content Migration Tool console runner.
---
[주요 콘텐츠로 건너뛰기](#main-content)

# 예: 마이그레이션 계획 스크립트 작성

**참고:** 이 항목에는 사용자의 요구 사항 및 환경을 충족하는 다중 계획 마이그레이션 스크립트를 작성할 때 기반으로 사용할 수 있는 샘플 스크립트가 포함되어 있습니다. 이 스크립트는 그대로 실행하는 것이 아니라 샘플 용도로만 사용하도록 만들어졌습니다. 콘솔 실행기 사용에 대한 자세한 지침은 [Tableau Content Migration Tool 콘솔 실행기 사용](https://help.tableau.com/current/online/ko-kr/cmt-deployment_console_runner.htm)을 참조하십시오.

마이그레이션 실행용 Tableau Content Migration Tool 명령줄 유틸리티를 사용하면 Windows 작업 스케줄러와 같은 외부 스케줄러나 사용자 지정 스크립트를 통해 마이그레이션 계획 실행을 자동화할 수 있습니다. 콘솔 실행기는 한 번에 한 마이그레이션 계획(.edt 파일에 저장되어 있음)만 실행합니다. 그룹으로 실행하려는 마이그레이션 계획 그룹이 있는 경우 Content Migration Tool 콘솔 실행기와 사용자 지정 스크립트를 조합하여 사용할 수 있습니다.

아래 예는 PowerShell에서 작성되었으며 콘솔 실행기를 사용하여 마이그레이션 계획 목록을 그룹으로 실행합니다.

다음 예제 코드는 다음을 수행합니다.

- 콘솔 실행기를 사용하여 여러 마이그레이션 계획을 그룹으로 실행합니다.
- 선택적으로, 그룹에 속한 마이그레이션 중 하나라도 실패하는 경우 즉시 계획 그룹의 배포를 중단합니다.
- 콘솔 실행기의 종료 코드를 사용하여 마이그레이션이 실패했는지, 아니면 경고를 기록했는지를 결정합니다.

\# List of migration plans to execute as a group.
$planFiles = @(
	'customer 1.tcmx',
	'customer 2.tcmx'
)

# True of false whether to continue with the next plan if a migration fails.
$continueOnFailure = $false
			
# Path to the CMT console runner executable
$runnerExe = 'C:\\Program Files (x86)\\Tableau\\Tableau Content Migration Tool\\tabcmt-runner.exe'

# Store the exit code from the previously run migration plan.
$lastResult = -1
			
# Loop through and run each migration plan one at a time.
$planFiles | % {
	$file = $\_
			
	if ($lastResult -ge 2 -and -not($continueOnFailure)) {
		Write-Warning "Skipping plan because previous migration failed. \`nSkipped plan: $file"
		return
	}
			
	Write-Verbose "Running migration plan: $file"
	& $runnerExe $file
       $lastResult = $LASTEXITCODE
 
 	if ($lastResult -ge 2) {
		Write-Error "Migration failed. See output or log file for error details.\`nPlan: $file" -ErrorAction 'Continue'
	}
	elseif ($lastResult -eq 1) {
		Write-Warning "Migration completed with warnings. See output or log file for warning details.\`nPlan: $file"
	}
}

## 이 작업을 수행할 수 있는 사용자

마이그레이션 계획의 스크립트를 작성하려면 다음이 모두 필요합니다.

- Content Migration Tool 컴퓨터에 대한 관리자 사용 권한
- Explorer 이상의 역할이 있는 Tableau 사이트 사용자 계정
- 원본 사이트에 대한 통합 문서 보기 및 다운로드/복사본 저장 사용 권한
- 대상 사이트에 대한 게시 권한