Export-DfsrClone
Export-DfsrClone
Exports the cloned DFS Replication database and volume configuration settings.
Sintassi
Parameter Set: Default
Export-DfsrClone [-Volume] <String> [[-Path] <String> ] [[-Validation] <ValidationLevel> {Basic | Full | None} ] [-AllowClobber] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descrizione dettagliata
The Export-DfrsClone cmdlet exports the DFS Replication database and volume configuration XML file settings for a given volume from the local computer, in order to clone that database on another computer. DFS Replication databases exist on every volume that contains replicated folder content and a single database contains references for all replicated folders on that volume. Once you run the cmdlet, it triggers the export in the DFS Replication service and waits for the service to complete the operation. Use Get-DfsrCloneState to monitor the export process.
DFSR does not support cloning SYSVOL or read-only replicas in Windows Server 2012 R2. These replicated folders are automatically skipped by the export process. You can only export or import one database at a time for a computer.
Follow the recommended and supported steps to perform DFS Replication database cloning, as described on 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.
Parametri
-AllowClobber
Indicates that the cmdlet overwrites an existing exported database and XML configuration file. By default, if a file exists in the specified path, the operation halts. 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.
Alias |
Overwrite |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Force
Forza l'esecuzione del comando senza chiedere conferma all'utente. Use this parameter for scripted cloning.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Path<String>
Specifies a folder path to which to write the exported DFS Replication files dfsr.db.clone and config.xml. The folder path must exist. The path must be a local volume and not a mapped drive or a UNC path. If you do not specify this parameter, the cmdlet uses the current working directory. After you export the DFS Replication files, but before you perform the import clone operation, you must populate the downstream server with the contents of the replicated folder.
Alias |
DestinationFolderPath |
Obbligatorio? |
false |
Posizione? |
2 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Validation<ValidationLevel>
Specifies the verbosity level of checks performed by the DFS Replication service against the replicated content set files and folders for comparison to the populated data on the destination clone during import. Acceptable values for this parameter are:
-- None (0) No validation is performed on the files, all files and folders are assumed to exist, and the administrator must have populated the files and folders without errors, or allowing any changes to the file structures on upstream and downstream servers. This is the fastest but most optimistic mode.
-- Basic (1) Simple comparisons are performed for every file and folder using the size, modified time-date stamp, and hash of the ACL. Any added, missing or differing files or folders are replicated inbound and any inconsistent local copies on the downstream are moved to the <replicated-folder>\Dfsrprivate\ConflictAndDeleted folder or to the <replicated-folder>\DfsrPrivate\PreExisting folder. This mode is a good balance of performance and optimism.
-- Full (2) DFS Replication hash computation is performed for every file and folder. Any missing or differing files or folders are replicated inbound and any inconsistent local copies on the downstream are moved to the <replicated-folder>\Dfsrprivate\ConflictAndDeleted folder or to the <replicated-folder>\DfsrPrivate\PreExisting folder. This is the slowest but most accurate mode.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
3 |
Valore predefinito |
Basic |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Volume<String>
Specifies a drive letter or mount point path that contains the database to export for that volume's replicated content folders, in order to perform cloning. If there are multiple replicated folders hosted on that volume, they all use the same DFS Replication database and they all clone. 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.
Alias |
nessuno |
Obbligatorio? |
true |
Posizione? |
1 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
True (ByValue, ByPropertyName) |
Accetta caratteri jolly? |
false |
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
False |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
False |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
<CommonParameters>
Questo cmdlet supporta i parametri comuni: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Per altre informazioni, vedere about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Input
Il tipo di input è il tipo degli oggetti che è possibile reindirizzare al cmdlet.
- string
Output
Il tipo di output corrisponde al tipo di oggetti generati dal cmdlet.
- DfsrFolderToSync
Esempi
Example 1: Export a database to a folder
This command exports the DFS Replication database clone for the C: volume into the C:\Dfsrclone destination folder and displays the associated replicated folders. The suggested Robocopy syntax appears in the output.
PS C:\> Export-DfsrClone -Volume C: -Path C:\Dfsrclone | Format-List
Example 2: Export a database and monitor progress
This example demonstrates exporting the DFS Replication database clone and then uses Get-DfsrCloneState to periodically retrieve state until the replication completes.
The first command uses the Export-DfsrClone cmdlet to start the export process. You must open another Windows PowerShell console or hit CTRL+C to exit the Export-DfsrClone cmdlet. The cloning continues on the server even if the cmdlet stops running.
The second command uses the Get-DfsrCloneState cmdlet to check the state of the export process. The output appears after the command.
The third command uses the Get-DfsrCloneState cmdlet to check the state of the export process. The output indicates that the export completed successfully.
PS C:\> Export-DfsrClone -Volume C: -Path C:\Dfsrclone -Force
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 "RF 5" | 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$\Rf05 /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