title: How to upload from Digital Ocean Storage to Google Cloud Storage, directly, programatically without rclone
body: <p>I want to migrate files from Digital Ocean Storage into Google Cloud Storage programatically without rclone.</p>
  <p>I know the exact location file that resides in the Digital Ocean Storage(DOS), and I have the signed url for the Google Cloud Storage(GCS).</p>
  <p>How can I modify the following code so I can copy the DOS file directly into GCS without intermediate download to my computer ?</p>
  <pre><code>def upload_to_gcs_bucket(blob_name, path_to_file, bucket_name):
      &quot;&quot;&quot; Upload data to a bucket&quot;&quot;&quot;
  
      # Explicitly use service account credentials by specifying the private key
      # file.
      storage_client = storage.Client.from_service_account_json(
          'creds.json')
  
      #print(buckets = list(storage_client.list_buckets())
  
      bucket = storage_client.get_bucket(bucket_name)
      blob = bucket.blob(blob_name)
      blob.upload_from_filename(path_to_file)
  
      #returns a public url
      return blob.public_url
  </code></pre>