About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
These are two separate checks, and they do not carry the same risk.
"The repository at location ... was previously located at ..." means Borg remembers the repository under another path or location and asks you to confirm the move. It is routine after a rename or a remount. "Cache, or information obtained from the security directory is newer than repository" means this machine has seen a later state of the repository than the one in front of it. Borg itself says it is "either an attack or unsafe", and a common honest cause is an older copy of the repository being put back.
Treat the first as a confirmation and the second as a stop-and-find-out.
What the error means
Borg keeps client-side state outside the repository: a local cache, and a security directory. The environment-variable reference says the security directory "contains information borg uses to track its usage of NONCES ('numbers used once' - usually in encryption context) and other security relevant data", and defaults to $BORG_CONFIG_DIR/security. The cache defaults to $BORG_BASE_DIR/.cache/borg and "might need a lot of space" (environment variables).
'Previously located at'
The environment-variable reference ties the setting BORG_RELOCATED_REPO_ACCESS_IS_OK to the warning Warning: The repository at location ... was previously located at .... The FAQ on renaming says nothing special is needed to rename a repository directory; afterwards "borg may warn you that the repository has been moved", and "If BORG_RELOCATED_REPO_ACCESS_IS_OK is unset, borg will interactively ask for each repository whether it's OK."
'Cache is newer than repository'
The FAQ section titled "this is either an attack or unsafe" warning gives the message as:
Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID)
It explains the two readings:
- Unsafe: "If not following the advice from the previous section, you can easily run into this by yourself by restoring an older copy of your repository."
- Attack: "maybe an attacker has replaced your repo by an older copy, trying to trick you into AES counter reuse, trying to break your repo encryption."
It also says users have reported that filesystem problems, such as I/O errors causing the filesystem to become read-only, can trigger it.
The security risk is counter reuse. The FAQ explains that Borg's encryption is AES-CTR, where "the nonce is a counter". If a repository is rolled back and then used, "Borg would re-use nonce values due to starting from a lower counter value given by the older copy of the repository". The internals page separately notes that replaying the manifest "will fail if the client has seen a more recent manifest". Taken together, the check compares what this client has already seen with what the repository now shows. Borg's documentation does not state that link in one sentence; treat it as the likely explanation, not a certainty.
A related point: Borg identifies a repository by an ID. The FAQ says a copy kept in sync with a tool shares that ID, "so the borg client will think they are identical", and "you must not run borg against multiple instances of the same repo."
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Repository renamed, moved, or remounted at another path | 'previously located at' prompt for one repository | You know the path changed; the new path is the one you intended |
| Older copy of the repository restored (from snapshot or file backup) | 'newer than repository' on the first run after the restore | Restore history; the repository's modification times are older than the last backup you ran |
| Two repositories with the same ID (a copied or synchronised repo, both in use) | Same warning, possibly after switching between locations | The same ID shows from both locations (read-only check below) |
| Someone replaced the repository with an older copy | Same warning, with no restore you can account for | No change record; check storage-side logs and access |
| Filesystem trouble under the repository or the client state | Same warning with read-only or I/O errors in system logs | System logs on the repository host and the client |
Prove the cause before changing anything
These commands are taken from the Borg documentation and have not been run. They only read.
Print the repository ID. The config page says that passing only a key name retrieves its value, and that the command "only works on local repositories":
borg config /path/to/repo id
Compare the ID from each place the repository might live. If two locations print the same ID, they are copies of one repository and must not both receive backups.
Then ask yourself, with dates:
- Did anyone move or rename the path? If yes, it is the 'previously located' case.
- Did anyone restore the repository from a snapshot, a replica or a file-level backup? When, and what was the repository's last backup before that?
- Did a replication job write to the repository from a second site?
Check the repository's health without writing, using the check usage options --repository-only and --archives-only. Avoid --repair, which the documentation calls "a POTENTIALLY DANGEROUS FEATURE" that "might lead to data loss".
Example (illustrative): the file server FS02 backs up to /srv/borg/fs02. The storage host is rebuilt from last week's image. On Monday night the job prints the "newer than repository" warning. borg config /srv/borg/fs02 id matches the ID the client has used for a year. The image predates six nightly runs, so the client has seen six newer manifests than the repository holds. This is the rollback case: the repository was genuinely restored from an older copy, not attacked, but the nonce risk is still real.
Fix
'Previously located at' after a real move
Answer the prompt for that repository when you are certain you moved it. The FAQ says you can set BORG_RELOCATED_REPO_ACCESS_IS_OK=yes "to avoid the prompts when renaming multiple repositories". In a scheduled job, set it only for the deliberate move and unset it afterwards. Left as yes permanently, it silences the prompt for a repository that moves unexpectedly, such as a mount that now points elsewhere.
This variable belongs to the 'previously located' warning only. The documentation does not connect it to the 'newer than repository' warning, and you should not expect it to clear it.
'Newer than repository': stop first
Stop scheduled backups to that repository. Work out which cause in the table applies.
If it was an unaccounted-for change: treat it as a possible compromise of the storage host. Preserve the repository and the logs as they are. Do not run the override below.
If you deliberately restored an older repository copy: the FAQ's recommended method for restoring an older copy of an encrypted repository with the same ID is to do it in this order, before the warning appears: borg delete --keep-security-info /path/to/repo, then rsync -aH /path/to/repo-working/ /path/to/repo (with the trailing slash). The --keep-security-info option is documented as "keep the local security info when deleting a repository", and the FAQ says it preserves "the client-side nonce counter". This deletes the damaged repository; copy it elsewhere first. If the warning has already appeared, that ordering has been missed.
The documented override. The FAQ gives a manual way to accept the state, and calls it "an unsafe and unsupported way to use borg, you have been warned":
borg config repo id # shows the REPO_ID
rm ~/.config/borg/security/REPO_ID/manifest-timestamp
borg delete --cache-only REPO
(As printed in the FAQ; repo stands for the repository, as in the config command above.) --cache-only is documented as "delete only the local cache for the given repository", and it forces a cache rebuild, which the FAQ warns "can be quite time consuming". Risky step: this removes the record of the latest state this client has seen, so the next backups can start from a lower counter than earlier ones. Do it only if you have established that the rollback was your own and you accept the counter-reuse risk, and consider the safer alternative below.
Safer alternative. The FAQ recommends separate repositories for redundancy: run borg init for each, back up to each, which creates "distinct repositories (separate repo ID, separate keys)", so "nothing bad happening in repo1 will influence repo2." For a rolled-back repository that you do not want to carry the risk forward, start a new repository and keep the old one read-only for restores.
Confirm the fix
- The next backup run completes without either warning.
borg checkwith--repository-only, then with--archives-only, reports no errors.- A restore is the real proof.
borg extractwrites into the current directory, so change to a scratch directory first, and use--dry-run("do not actually change any files") to read and verify archive data without writing, then extract a sample for real and compare it with the source. borg liston the repository shows the archives you expect, including the most recent one you remember making.
What to watch afterwards
- Alert on any Borg warning in job output, not only non-zero exit.
- Record every repository move and every restore of a repository, with date and who did it.
- One writer per repository. The FAQ says multiple clients into one repository is possible but "not recommended from the security perspective", and simultaneous backups can fail on Borg's exclusive lock.
- Recurrence signal: the 'newer than repository' warning returning with no restore on record.
Read next
Related articles you may want next.
- Backup & RecoveryWhat restic and Borg repository checks prove, and what only a restore canWhat restic check, --read-data, borg check and --verify-data actually prove, what they cost, and the restore test that covers what they cannot.Read article
- Backup & Recoveryrestic: 'repository is already locked': stale locks, running jobs and when to unlockrestic says the repository is already locked. Tell a live job from a stale lock, read the lock safely, and know what restic unlock and --remove-all remove.Read article
- Backup & RecoveryHunting the backup catalogue before you restore after ransomwareHow to read backup records after ransomware to compare recovery-point evidence, intrusion timing and surviving copies before choosing a restore.Read article
Risks and limits
- These commands have not been run or lab-tested.
- Every statement here is from the Borg 1.4.5 documentation (stable pages, no date displayed). Borg 2.x was not checked and may behave differently.
- The documentation gives no safe, supported way to clear the 'newer than repository' warning. The only documented path is labelled unsafe and unsupported.
- Borg's documentation does not state the link between the manifest-replay sentence and this warning directly; treat it as the likely explanation, not a certainty.
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OKexists for a third warning ("Attempting to access a previously unknown unencrypted repository") and is not part of this fault.- Counter-reuse risk applies to encrypted repositories. The documentation does not break it down by encryption mode.
Sources
- Environment variables (general usage) — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
- FAQ — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
- Internals: data structures and security — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
- borg config — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
- borg delete — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
- borg check — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
- borg extract — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
- borg list — BorgBackup documentation 1.4.5, date not shown, accessed 16 November 2026
This article was originally published on .