Rename Document / Change Document ID

Rename Document / Change Document ID

The official Firebase Console is missing some essential features like the ability to rename documents (change the document ID). Previously you had to create a new document with the same data and delete the old document manually or write a script that does this for you. When the document contained subcollections, they needed to be transferred to the new document as well.

Renaming a Document using Firefoo

  1. Download and install Firefoo.
  2. Click the collection in the sidebar on the left.
  3. Find the document in the output table. If the document is not visible right away, you can click load more until it is visible. If your collection has too many documents, use theWhere, Order by or Limit fields and click Run to find it. Another alternative is to enter the document path directly in the Path field, e.g. myCollection/myDocumentId and click the Run button.
  4. Right-click on the left-most cell (ID column) of the document and choose Rename Document.
    default
  5. Change the last part of the Target Path to the new document name.
    default
  6. That’s it! Confirm with OK.
If your document contains subcollections, Firefoo will automatically copy them over to the new location, which might take some time. You can track the progress in the Tasks popup, reachable through FileTasks.

FAQ

How many requests will this use from my quota?

Renaming a document will use at least 4 requests: two reads, one write and one delete. The two reads are due to the additional request to check whether the document has subcollections or not.
If there are subcollections, these same 4 requests are repeated for every document in the subcollections.