# Synchronize FTP and SFTP directories

Synchronize FTP and SFTP directories on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

Transferetto

Small PowerShell module with FTPS/SFTP functionality

[View on GitHub](https://github.com/EvotecIT/Transferetto) [Visit Website](#) [Releases](https://github.com/EvotecIT/Transferetto/releases/tag/Transferetto-v2.0.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/Transferetto)

Stars**94**

Forks**17**

Open issues**0**

PowerShell Gallery downloads**14067470**

Release**v2.0.4**

Language: C# Updated: 2026-12-03

Curated Examples

Plan, preview, update, and mirror directory trees with Transferetto sync cmdlets.

Use synchronization when a folder transfer should compare both sides before acting. The sync cmdlets can preview planned work, update only missing or changed files, mirror-delete extra destination items, filter paths, and choose how files are compared.

## Example

```powershell
Import-Module Transferetto

$credential = Get-Credential
$sftpClient = Connect-SFTP -Server 'sftp.example.com' -Credential $credential

Sync-SFTPDirectory -SftpClient $sftpClient `
    -LocalPath "$PSScriptRoot\Upload" `
    -RemotePath '/incoming/releases' `
    -Mode Mirror `
    -Include '*.zip', '*.json' `
    -Exclude 'archive/*' `
    -DryRun

Sync-SFTPDirectory -SftpClient $sftpClient `
    -LocalPath "$PSScriptRoot\Upload" `
    -RemotePath '/incoming/releases' `
    -Mode Mirror `
    -Include '*.zip', '*.json' `
    -Exclude 'archive/*' `
    -ShowProgress

Disconnect-SFTP -SftpClient $sftpClient
```

## Useful options

- `-Direction Upload` treats the local folder as source.
- `-Direction Download` treats the remote folder as source.
- `-Mode Update` leaves extra destination files alone.
- `-Mode Mirror` removes destination files and folders that are not in the source.
- `-Comparison Size`, `-Comparison LastWriteTime`, and `-Comparison SizeOrLastWriteTime` control change detection.
- `-DryRun` returns the planned actions without changing local or remote files.

## Source

- [Example40-SyncDirectories.ps1](https://github.com/EvotecIT/Transferetto/blob/master/Examples/Example40-SyncDirectories.ps1)

<!-- PowerForge markdown artifact sha256:F4FCF5ADC6C22F1A0020232AF6D5AC88309DE7A37294B28E23F57EF4E2F0BE54 -->
