Back to blog

How to Move and Rename Files with Zapier

Move, rename, and archive files on SFTP/FTP/S3 servers directly from Zapier with PushFTP.

·5 min read

Why Move and Rename?

Files arrive in one place but need to be somewhere else. Processed invoices go to an archive folder. Uploaded images get renamed with a date prefix. Temp files move to their final location after validation. PushFTP's Move/Rename File action in Zapier handles this server-side — no download and re-upload needed.

Moving happens directly on your SFTP, FTP, or S3 server through PushFTP's fixed IP address. The file never leaves the server; only the path changes.

What You Need

  • A PushFTP account with a connection (sign up free)
  • PushFTP's static IP whitelisted on your server
  • A Zapier account
  • Write permissions on both the source and destination directories

Step 1: Pick Your Trigger

Move/rename is typically a follow-up action. Common triggers:

After processing a new file:

Trigger: PushFTP → New File Detected (/incoming/)
Action 1: PushFTP → Download File (process it)
Action 2: PushFTP → Move File (archive it)

On a schedule:

Trigger: Schedule → Every Night at midnight
(move yesterday's files to archive)

From another app:

Trigger: Webhooks → POST from your processing pipeline

Step 2: Add the Move/Rename Action

In your Zap:

  1. App: PushFTP
  2. Event: Move/Rename File
  3. Account: Your PushFTP account

Configure:

Connection: My SFTP Server
Source Path: /incoming/report.csv
Destination Path: /archive/2025-01-15-report.csv

Or map dynamically from a trigger:

Source Path: {{path from trigger}}
Destination Path: /processed/{{filename from trigger}}

Understanding Move vs. Rename

They're the same operation — it's just about what changes:

Move (different directory, same name):

Source: /incoming/report.csv
Destination: /archive/report.csv

Rename (same directory, different name):

Source: /incoming/report.csv
Destination: /incoming/report-final.csv

Move and rename (both change):

Source: /incoming/report.csv
Destination: /archive/2025-01-15-report-final.csv

PushFTP handles all three in one action. Just specify the full source and destination paths.

Step 3: Test It

Create a test file:

echo "test" | sftp user@server:/test/ <<< "put /dev/stdin move-test.txt"

Set the action to move /test/move-test.txt to /test/archive/moved-test.txt. Make sure /test/archive/ exists (create it with a Create Folder action if needed). Run the test.

Check that the file is gone from /test/ and present in /test/archive/.

Common Workflows

Process and Archive

The classic pattern — process a file, then move it out of the incoming folder:

Trigger: PushFTP → New File Detected (/incoming/)
Action 1: PushFTP → Read File
Action 2: Formatter → Parse CSV
Action 3: Google Sheets → Create Rows
Action 4: PushFTP → Move File
  From: {{path}}
  To: /archive/{date}-{{filename}}

This prevents the same file from being processed twice. The watched folder only detects new files, and the move ensures processed files are gone before the next poll.

Staging to Production

Upload files to a staging area, validate them, then move to production:

Trigger: PushFTP → New File Detected (/staging/)
Action 1: PushFTP → Read File (validate content)
Action 2: Filter → Only continue if valid
Action 3: PushFTP → Move File
  From: /staging/{{filename}}
  To: /production/{{filename}}

Rename With Timestamp

Add a timestamp to filenames to prevent collisions:

Trigger: PushFTP → New File Detected (/uploads/)
Action 1: Formatter → Date/Time → Format current date
Action 2: PushFTP → Move File
  From: {{path}}
  To: /uploads/{{formatted_date}}-{{filename}}

Or use PushFTP's filename templates in other actions. The upload docs cover all available template placeholders.

Organize by Date

Sort files into year/month folders:

Trigger: PushFTP → New File Detected (/inbox/)
Action 1: Formatter → Date/Time → Format as "2025/01"
Action 2: PushFTP → Create Folder
  Path: /archive/{{formatted_date}}/
Action 3: PushFTP → Move File
  From: {{path}}
  To: /archive/{{formatted_date}}/{{filename}}

Moving on S3

For S3 connections, move works as a copy + delete operation (that's how S3 works under the hood). The source and destination must be in the same bucket:

Connection: My S3 Bucket
Source: incoming/report.csv
Destination: processed/2025-01-15-report.csv

PushFTP handles this through its static IP address, so your S3 bucket policy only needs to allow one IP. Check the IP whitelisting guide for S3 bucket policy examples.

Error Handling

Common move failures:

  • Source file doesn't exist — the action fails. Add a Find File check first
  • Destination directory doesn't exist — create it first with Create Folder
  • Permission denied — the SFTP user needs write access to both source and destination directories
  • Destination file already exists — behavior varies by server. Some overwrite, some reject. Use unique filenames to avoid conflicts

For critical workflows, set up the Transfer Failed trigger to catch and alert on failures.

Server-side moves are fast, clean, and atomic — no downloading and re-uploading. One action in your Zap, and files are exactly where they need to be, named exactly what they should be.

FAQ

Does moving a file trigger the New File Detected watch?

If you move a file into a watched folder, yes — PushFTP will detect it as a new file on the next poll. Be careful not to create loops (watching a folder and moving files into it from the same trigger).

Can I move files between different servers?

No. Move/Rename operates on a single server. To transfer files between servers, use Download File from one connection, then Upload File to another. Both go through PushFTP's fixed IP.

Can I move entire directories?

The Move/Rename action works on individual files. To move all files in a directory, use List Files to get the file list, then loop through with Move File for each one.

Does the move happen instantly?

On SFTP and FTP, moves within the same filesystem are nearly instant (it's a rename at the filesystem level). On S3, it's a copy + delete, so it depends on file size. For most files, it's fast.

Keep Things Organized

Move and rename actions are the organizational backbone of file automation. They keep directories clean, prevent reprocessing, and give your files a logical structure. Combined with PushFTP's other actions, you can build workflows that not only process files but leave everything tidy afterward.

Ready to automate your file transfers?

Connect to any SFTP, FTP, or S3 server from a fixed IP address. Free plan available — no credit card required.