title: How to get the firebase storage path from the the storage url?
body: <p>I'm trying to write a migration script to copy the storage urls stored in firestore from the development project to the staging and production projects.</p>
  
  <p>I'm querying all documents in Firestore, filtering the documents that contain one of the two strings:</p>
  
  <pre><code>https://firebasestorage.googleapis.com/v0/b/${BUCKET_ID}/o/{FILEPATH}
  </code></pre>
  
  <pre><code>https://storage.googleapis.com/${BUCKET_ID}/{FILEPATH}
  
  </code></pre>
  
  <p>I noticed the first is used when the image was uploaded from the javascript client and the second when it was uploaded from Cloud Functions.</p>
  
  <p>Is there an easy to get the storage path from the urls without parsing them?
  Is there an easier way to achieve migrating storage urls to a new project?</p>
  
  <p><em>Note: I want to get the storage path from the url. I know the other way around is straightforward.</em></p>