Originally published on 2014-02-18; fully revised and updated.
If you administer a Perforce server, these commands are the building blocks for consistent backups and recovery. This rewrite expands the original command list from the source article into a practical runbook-style reference.

Perforce backup command reference
The original post highlights that the -z flag enables compression. The table below summarizes each command and its purpose.
| Command | Primary purpose | When to use it |
|---|---|---|
p4d -jc [-z] | Take a checkpoint and rotate the journal | Standard scheduled backup point |
p4 admin checkpoint [-z] | Trigger checkpoint and journal handling from client side | When you operate through admin commands instead of direct server shell usage |
p4d -jj [-z] | Rotate journal only | When you need journal rotation without creating a new checkpoint |
p4d -jr [-z] filename | Restore from a journal file | Recovery and replay operations |
p4d -jd [-z] filename | Write checkpoint to a specific file without incrementing checkpoint or journal counters | Manual or ad hoc checkpoint exports |
p4d -c command | Lock database files and run a command | Consistent file-level operations while DB files are locked |
p4d commands vs p4 admin checkpoint
| Option | Execution style | Typical operator context |
|---|---|---|
p4d -jc and related p4d flags | Run directly on the server host | Platform or infrastructure admins with shell access |
p4 admin checkpoint | Run as a Perforce admin command from client side | Perforce administrators managing backups through server command interfaces |
Backup and recovery workflow
A safe operating pattern is to create a checkpoint, rotate and archive journals, and regularly validate that restoration works in a non-production environment.
flowchart TD
A[Plan backup window] --> B[Run checkpoint and rotate journal]
B --> C[Archive checkpoint and journal files]
C --> D[Test restore in non production]
D --> E{Restore successful}
E -- no --> F[Fix runbook and repeat test]
E -- yes --> G[Keep retained backup sets]
Example command patterns
Use these examples as templates and replace paths with your own server root and backup locations.
# Create a checkpoint and rotate journal
p4d -r /p4/1/root -jc -z
# Rotate journal only
p4d -r /p4/1/root -jj -zCode language: PHP (php)
# Create a checkpoint file without incrementing checkpoint or journal counters
p4d -r /p4/1/root -jd -z /backups/checkpoint.manual.gz
# Lock database files and run a copy command
p4d -r /p4/1/root -c "cp -a db.* /backups/db-snapshot/"Code language: PHP (php)
Journal restore example
# Replay a compressed journal file during recovery
p4d -r /p4/1/root -jr -z /backups/journal.42.gzCode language: PHP (php)
Common pitfalls
- Running backup commands without documenting file naming and retention conventions.
- Keeping backups but not performing periodic restore tests.
- Mixing manual and automated checkpoint flows without clear runbook ownership.
- Assuming all command flags behave identically across all Perforce server versions.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals