Import-DfsrClone

Import-DfsrClone

Imports a cloned DFS Replication database and volume configuration settings.

구문

Parameter Set: Default
Import-DfsrClone [-Volume] <String> [-Path] <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Import-DfsrClone cmdlet imports a DFS Replication database and volume configuration XML file settings for a given volume from another computer, in order to clone that database on the local computer. DFS Replication databases exist on every volume that contains replicated folder content and a single database contains references for all replicated folders. When you run this cmdlet, it triggers the import in the DFS Replication service and waits for the service to complete the operation. Use Get-DfsrCloneState to monitor the import process.

Important: DFS Replication does not support cloning SYSVOL or read-only replicas in Windows Server 2012 R2. The export process skips replicated folders automatically. You can only export or import one database at a time for a computer.

Use the recommended and supported steps to perform DFS Replication database cloning. For more information, see the following Microsoft web site: https://go.microsoft.com/fwlink/?LinkId=302005. The term upstream refers to the server that is the authoritative source of both replicated file data and the DFS Replication database. The term downstream refers to the non-authoritative server that is a clone of the authoritative server.

매개 변수

-Force

사용자 확인을 요구하지 않고 명령을 실행합니다. Use this parameter for scripted cloning.

별칭

없음

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Path<String>

Specifies a location from which to read the exported DFS Replication database and volume configuration XML file. After you export the DFS Replication database, but before you perform the import clone operation, you must populate the downstream server with the contents of the replicated folder.

별칭

SourceFolderPath

필수 여부

true

위치

2

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Volume<String>

Specifies a drive letter or mount point that contains the populated DFS Replication file contents. This volume will contain the previously exported database once the import is complete. After you export the DFS Replication database, but before you perform the import clone operation, you must populate the downstream server with the contents of the replicated folder.

별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

True (ByValue, ByPropertyName)

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • string

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • [none]

예제

Example 1: Clone and import a DFS Replication database

This command clones and imports the DFS Replication database and volume configuration XML to the C: volume from the C:\ Dfsrclone folder.

PS C:\> Import-DfsrClone -Volume c: -Path C:\dfsrclone

Example 2: Import a DFS Replication database and periodically check status

This example imports a DFS Replication database clone and then uses the Get-DfsrCloneState cmdlet to periodically check the state until the replication operation completes.

The first command uses the Import-DfsrClone cmdlet to start the import process. You must open another Windows PowerShell console or hit CTRL+C to exit the Import-DfsrClone cmdlet. Even if the cmdlet stops running, the cloning continues on the server.

The second command uses the Get-DfsrCloneState cmdlet to check the state of the import process. The output appears after the command.

The third command uses the Get-DfsrCloneState cmdlet to check the state of the import process. The output indicates that the import succeeded.

PS C:\> Import-DfsrClone -Volume C: -Path C:\dfsrclone
PS C:\> Get-DfsrCloneState
PS C:\> Get-DfsrCloneState
PS C:\> Get-DfsrCloneState

Example 3: Export and import a database

This example demonstrates the end-to-end process of cloning SRV01 and its RF05 replicated folder on C:\ to server SRV02. The first seven commands run on the upstream server, and the remaining commands run on the downstream server.

The first command, on the upstream server, uses the New-DfsReplicationGroup cmdlet to create a replication group named RG05. The output of that command is piped to the New-DfsReplicatedFolder cmdlet to create a folder named RF05, and the output of that command is piped to the Add-DfsrMember cmdlet to add the computer named SRV01 as a member.

The second command, on the upstream server, uses the Set-DfsrMembership cmdlet to modify the membership for the computer named SRV01.

The third command, on the upstream server, uses the Update-DfsrConfigurationFromAD cmdlet to update the DFS Replication configuration on the source server.

The fourth command, on the upstream server, uses the New-Item cmdlet to create a new directory in the path C:\Dfsrclone.

The fifth command, on the upstream server, uses the Export-DfsrClone cmdlet to export a volume.

The sixth command, on the upstream server, uses Robocopy to copy the replicated folder directory structure to the destination server.

The seventh command, on the upstream server, uses Robocopy to copy the C:\Dfsrclone directory to the destination server.

The eighth command, on the downstream server, uses RD to remove the replication directory, if it exists.

The ninth command, on the downstream server, uses the Import-DfsrClone cmdlet to import the database and volume configuration on the destination server.

The tenth command, on the downstream server, uses the Get-DfsrCloneState cmdlet to verify the completion of the import process.

The eleventh command, on the downstream server, uses the Add-DfsrMember cmdlet to add a new group on the destination server. The command pipes the output of this cmdlet to the Set-DfsrMembership cmdlet to add membership for the replicated folder group.

The twelfth command, on the downstream server, uses the Add-DfsrConnection cmdlet to add a connection for the destination server.

The final command, on the downstream server, uses the Update-DfsrConfigurationFromAD cmdlet to update the DFS Replication configuration on the destination server.

PS C:\> New-DfsReplicationGroup "RG05" | New-DfsReplicatedFolder -FolderName "RF05" | Add-DfsrMember -ComputerName "SRV01"
PS C:\> Set-DfsrMembership -ComputerName "SRV01" -ContentPath "C:\Rf05" -PrimaryMember $True -FolderName "RF05"
PS C:\> Update-DfsrConfigurationFromAD
PS C:\> New-Item -Path "C:\Dfsrclone" -Type Directory
PS C:\> Export-DfsrClone -Volume C: -Path "C:\Dfsrclone"
PS C:\> Robocopy.exe C:\Rf05 \\srv02\c$\Rf5 /E /B /COPYALL /R:6 /W:5 /MT:64 /XD DfsrPrivate /TEE /LOG+:preseed.log
PS C:\> Robocopy.exe C:\Dfsrclone \\srv02\c$\Dfsrclone /B
PS C:\> RD "C:\system volume information\dfsr" –Force -Recurse
PS C:\> Import-DfsrClone -Volume C: -Path "C:\Dfsrclone"
PS C:\> Get-DfsrCloneState
PS C:\> Add-DfsrMember -GroupName "RG05" -ComputerName "SRV02" | Set-DfsrMembership -FolderName "RF05" -ContentPath "C:\Rf05"
PS C:\> Add-DfsrConnection -GroupName "RG05" -SourceComputerName "SRV01" -DestinationComputerName "SRV02"
PS C:\> Update-DfsrConfigurationFromAD

관련 항목

Export-DfsrClone