Unable to restore a 6.0.15 backup to 6.3

Step:

  1. backup
  2. restore with default options
fdbrestore start -r file:///data0/fdbbackup/backup/backup-2022-06-21-17-53-23.253347/ --dest_cluster_file /etc/foundationdb/fdb.cluster -n
No restore target version given, will use maximum restorable version from backup description.
Using target restore version 1741519332000
ERROR: Backup before 6.3 cannot be filtered with key ranges
Fatal Error: Backup before 6.3 cannot be filtered with key ranges

Ah, I see. 6.0.16 had a backup folder scheme change so earlier versions would not understand it.

The problem can be reproduced when I tried to restore a backup from 6.2.98 into 6.3.24, I found the error message:

...
Tag: default  UID: 81bf2873a4fe5d159bc20aeaa4765f26  State: starting  Blocks: 0/0  BlocksInProgress: 0  Files: 0  BytesWritten: 0  CurrentVersion: -1  FirstConsistentVersion: 0  ApplyVersionLag: 0  LastError: ''Backup before 6.3 cannot be filtered with key ranges' on 'restore_start'' 10s ago.
...

Are you trying to do a partial restore of a specific key range by passing key ranges to fdbrestore start?

What you are encountering is a a bug, unfortunately. If the answer to the question above is Yes, then it’s an unfortunate bug but the solution is to do a full restore instead. If the answer is No, then it is a serious bug in restore initialization.

In FDB 6.3, partial restore was made more efficient by adding metadata to the backup which enables skipping unneeded backup files for a partial restore. This error is complaining that that metadata is missing, however it really should not be required. The metadata makes partial restore more efficient but they are still possible without it.

If you can do a full restore instead, please try that.

@SteavedHams thanks for your suggestion! Now my backup and restore is both full database, and there is only a test key in the database, and it prompt the following error message:

...
Event Severity="40" ErrorKind="Unset" Time="1665553700.680543" DateTime="2022-10-12T05:48:20Z" Type="StopAfterError" ID="0000000000000000" Error="backup_not_filterable_with_key_ranges" ErrorDescription="Backup before 6.3 cannot be filtered with key ranges" ErrorCode="2320" ThreadID="16070572329380449811" Backtrace="addr2line -e fdbrestore.debug -p -C -f -i 0xbb78cc 0xbb88f0 0xbb8c81 0x4e6d7b 0x4e6fd2 0x50e6f9 0x4f3c44 0x4f3cd5 0x5795d1 0x5a5412 0x5a5498 0x5a21a9 0x5a6218 0x512378 0x4dc40f 0xafac60 0x5e95e0 0xb5b047 0x892212 0x4c9840 0x7fb48ff2be50" Machine="0.0.0.0:0" LogGroup="" 
...

database backup from : 6.2.29
backup restore into : 6.3.24

I have checked the foundationdb code and found the following code:

...
// Old backup does not have metadata about key ranges and can not be filtered with key ranges.
if (keyRangesFilter.size() && results.second.empty() && !results.first.empty()) {
	throw backup_not_filterable_with_key_ranges();
}
...

It seems fdb 6.2 backup does not have metadata about key ranges and can not be filtered with key ranges, right?
Is there any workaround to fix it? To restore 6.2 backup into 6.3 database. Any more suggestion? Thanks!

If you are doing a full restore, without passing any target key ranges to fdbrestore start then you should not see this message.

I have the same issue too when I tried to restore w/o any key range. The cluster now is 6.3.24.
fdbrestore start -r file:///var/fdb/data/backup-2022-08-31-00-00-29.126425 --dest_cluster_file /tmp/fdb.cluster

fdbrestore status --dest_cluster_file /tmp/fdb.cluster
Tag: default UID: 7bb0c96c717df816a19748b5dd393ed6 State: starting Blocks: 0/0 BlocksInProgress: 0 Files: 0 BytesWritten: 0 CurrentVersion: -1 FirstConsistentVersion: 0 ApplyVersionLag: 0 LastError: ‘‘Backup before 6.3 cannot be filtered with key ranges’ on ‘restore_start’’ 2s ago.
URL: file:///var/fdb/data/backup/backup-2022-08-31-00-00-29.126425 Range: ‘’-‘\xff’ AddPrefix: ‘’ RemovePrefix: ‘’ Version: 3434005309252