Skip to main content
Version: v10.x - Umbraco 10

Empty Files

Along with tracking all the creations and edits you do inside Umbraco, uSync will track when things are renamed, moved or deleted.

Empty files are markers to tell uSync that an item needs to be renamed, moved or deleted.

When you delete or rename an item, uSync will overwrite the existing config file for that item with an Empty file. The Empty file contains the instruction for uSync on what to do with that item when a sync occurs.

Example Empty file contents
<?xml version="1.0" encoding="utf-8"?>
<Empty Key="797e2039-149b-41cd-8ce8-4cc339b015c2" Alias="contentPage" Change="Delete" />

For example: If you delete a doctype, then the Empty file will contain a delete command. This way when the files are imported onto a new site, uSync will know to delete the doctype based on the key and alias in the file.

When these files are synced with another site uSync will see that you have a delete in the folder, and the existing item will be deleted if present.

Why These Files Exist​

uSync uses Empty files to process these commands for two reasons.

  1. With the file in the correct location, any actions will happen in the right part of the sync process.
  2. These files overwrite existing config files so that if you copy or deploy the uSync folder then the old data for a removed item cannot be reimported by mistake.

Empty File Lifetime.​

Delete and rename commands will remain in your uSync folder, even if you perform an export operation. Empty files will be removed from the folder if:

  1. You create a new item with the same name/alias as an deleted or renamed item During this process uSync will find the empty file and either overwrite it or change it to a rename as needed.
  2. You perform a clean export A clean export deletes all files from the uSync folder, before performing an export, this removes all rename and delete files from an exported folder.
tip

If you perform a clean export you should ensure that when you copy the uSync files to another site, existing files are removed from the target sites uSync folder first.