Overview
Restoring a vault metadata copy without the file data is a common occurrence when, for example, testing database restore or investigating an issue in a vault.
Using the existing documents in the restored vault to test functionalities is often quicker and corresponds better to the actual usage of the vault.
However, many of the operations in the vault will cause an error message, as the actual file of that document does not exist. It is not possible to drag and drop a new file on top of the missing one, as that will also cause an error. Attempting to make a copy of the existing object will also throw an error.
Attempting to drag and drop a new document on top of existing:
Will lead to:
Attempting to preview document will throw:
See the sample stack at the end of the document.
Solution
Convert the existing document to a multi-file document. Add your new test file, remove the original file, and convert it back to a single file, as needed.
In case the document is already a multi-file, you can just remove the non-existing file and add your new test file.
Sample stack
Error thrown when attempting to replace a document with a new one when the file does not exist:
CoDropTarget.cpp, 553, An internal error occurred. (0x8007054F)
CoDropTarget.cpp, 932, An internal error occurred. (0x8007054F)
CoDropTarget.cpp, 1403, An internal error occurred. (0x8007054F)
MFShellCommands.cpp, 12029, An internal error occurred. (0x8007054F)
CoShellFolder.cpp, 6943, An internal error occurred. (0x8007054F)
FileHelper.cpp, 3887, An internal error occurred. (0x8007054F)
(M-Files 23.8.12892.6 2023-09-25T06:08:32.810Z)
