How to import/export existing Google Docs, but not convert everything else to Google Docs?

What is the problem you are having with rclone?

I have a few directories that contain Google documents that I want to have exported to docx during sync, and I'm happy to have those files sync'ed back to Google documents. (If they can't be re-imported, then I'm fine with them being saved as a docx file beside the google document file that they originated on).

However, I also have a few thousand other documents that I do not want to be converted to Google Doc formats, I want those to stay as docx/xlsx/etc files.

Reading the documentation on the --drive-export-formats, --drive-import-formats and --drive-skip-docs, it's sounds like:

  • --drive-export-formats will do the export that I need, but
  • not using --drive-import-formats causes the sync to fail (as per log below)
  • using --drive-import-formats would import all files into google docs instead of only those that came from google docs in the first place,
  • using --drive-skip-gdocs to allow syncing back to google drive as docx files would disable the --drive-export-formats option as well (basically skips all google documents handling).

Have I understood this properly? Is there a way to limit the import of files to google docs to only those that already exist as google docs?

The issue is coming up as a result of trying to share documents between my mobile and my PC. On the mobile, the document is being created - and at present the easiest way to create the file to save to google drive has been as a google doc. But then I need to use it on the desktop later, so I need the file in docx format there. I don't want to potentially start creating several thousand unnecessary google documents and lose formatting/other information by testing it on the directory tree to be synced, so I wanted to check my understanding first.

Run the command 'rclone version' and share the full output of the command.

$> rclone version
rclone v1.62.2
- os/version: debian 11.7 (64 bit)
- os/kernel: 5.10.0-22-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone bisync --resync --links --metadata --fast-list --track-renames  -v ~/GoogleDrive/username@supportbudget.com/UsernameDropboxFiles supportbudget:

The rclone config contents with secrets removed.

[supportbudget]
type = drive
client_id = <redacted>.apps.googleusercontent.com
client_secret = <redacted>
scope = drive
root_folder_id = 1JauDD-mg4I0NR8Z7jwXNNlWcamtnbbZ9
token = {"access_token":<redacted>,"token_type":"Bearer","refresh_token":<redacted>,"expiry":"2023-06-18T18:58:51.311473692+10:00"}

A log from the command with the -vv flag

Full log at Gist: Rclone bisync log · GitHub

Last section showing issue with needing --drive-import-formats when google docs have been converted to docx and then syncing back:

2023/06/18 19:13:56 DEBUG : NDIS/Plans/2021-12-10/Plan Preparation/Environment And Supports/HospitalDischarge10March2021.pdf: Size and modification time the same (differ by -410µs, within tolerance 1ms)
2023/06/18 19:13:56 DEBUG : NDIS/Plans/2021-12-10/Plan Preparation/Environment And Supports/HospitalDischarge10March2021.pdf: Unchanged skipping
2023/06/18 19:13:56 DEBUG : NDIS/Plans/2021-12-10/Plan Preparation/Environment And Supports/NDIS_HomeAssistanceNeeded.odt: Size and modification time the same (differ by -520µs, within tolerance 1ms)
2023/06/18 19:13:56 DEBUG : NDIS/Plans/2021-12-10/Plan Preparation/Environment And Supports/NDIS_HomeAssistanceNeeded.odt: Unchanged skipping
2023/06/18 19:13:56 DEBUG : NDIS/Plans/2021-12-10/Plan Preparation/Environment And Supports/NDIS_HomeAssistanceNeeded.pdf: Size and modification time the same (differ by -589µs, within tolerance 1ms)
2023/06/18 19:13:56 DEBUG : NDIS/Plans/2021-12-10/Plan Preparation/Environment And Supports/NDIS_HomeAssistanceNeeded.pdf: Unchanged skipping
2023/06/18 19:13:56 DEBUG : Google drive root '': Waiting for renames to finish
2023/06/18 19:13:56 DEBUG : Google drive root '': Waiting for transfers to finish
2023/06/18 19:13:56 ERROR : NDIS/Plans/2021-12-10/2023-06-09_PRN_WheelchairTaxis/ClaimReceipt_342411936_ToWork.docx: Failed to copy: can't update google document type without --drive-import-formats
2023/06/18 19:13:56 ERROR : NDIS/Plans/2021-12-10/2023-06-05_339170982_339172252_WheelchairTaxis/ClaimReceipt_339172252_ToHome.docx: Failed to copy: can't update google document type without --drive-import-formats
2023/06/18 19:13:56 ERROR : NDIS/Plans/2021-12-10/2023-06-05_339170982_339172252_WheelchairTaxis/ClaimReceipt_339170982_ToWork.docx: Failed to copy: can't update google document type without --drive-import-formats
2023/06/18 19:13:56 ERROR : NDIS/Plans/2021-12-10/2023-06-09_PRN_WheelchairTaxis/ClaimReceipt_342459111_ToHome.docx: Failed to copy: can't update google document type without --drive-import-formats
2023/06/18 19:13:56 ERROR : NDIS/Plans/2021-12-10/2023-06-15_PRN_PerxHealth/ClaimReceipt_342460026.docx: Failed to copy: can't update google document type without --drive-import-formats
2023/06/18 19:13:56 ERROR : Google drive root '': not deleting files as there were IO errors
2023/06/18 19:13:56 ERROR : Google drive root '': not deleting directories as there were IO errors
2023/06/18 19:13:56 DEBUG : Lock file removed: /home/username/.cache/rclone/bisync/local{b6816}__home_username_GoogleDrive_username@supportbudget.com_UsernameDropboxFiles..supportbudget_.lck
2023/06/18 19:13:56 ERROR : Bisync critical error: can't update google document type without --drive-import-formats
2023/06/18 19:13:56 ERROR : Bisync aborted. Must run --resync to recover.

There is no log below

ok there is:) sorry. have not noticed link

The log was about 64,000 lines, so I thought using the option to post a gist link for it was more appropriate than posting it directly into the question. :slight_smile:

I've updated the post to at least add the bit at the end of the log where it complained about syncing docs that had been extracted from google docs to docx back to google drive again, but I've also kept the link to the full log for reference/if anything further was needed.

I am afraid there is no universal solution for this problem - bisync + google docs conversions + your requirements wont work IMHO.

What about just do what you need to edit on mobile and desktop in separate folder? so you do not have to worry about 1000s of other files.

I cannot separate the documents from android & PC - they're combinations of invoices + receipts that need to be recorded/stored together for record-keeping/audit purposes, it's just that one part of the process is much easier to do via an android app so I end up with a mix between PC handling and Android handling. Edit: I just realised I'd misread - but the issue is that the list of transactions has lots of individual sets of invoices/receipts for the last couple of years, so I don't really want to split new ones out to a different storage location from all the prior invoices/receipts.

What I can do is tell Google Docs on Android to save documents as Word files instead of as a Google Doc, and I've gone through the dozen or so existing Google Docs and manually converted those to Word files on Google Drive then deleted the original Google Doc. Once I'd done that, I could use the --drive-skip-gdocs option for the sync as I wasn't storing/needing to sync Google Docs anymore.

If I do end up needing Google Docs for other purposes, I'll make sure to store them in a different directory tree that can be individually sync'ed, so that all files in that directory tree can be converted to/from Google Docs in the sync process.

Thank you for your assistance, and your confirmation that I was understanding the documented options correctly. :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.