Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't restore to a different mailbox #72

Closed
beamends opened this issue Apr 18, 2023 · 5 comments
Closed

Can't restore to a different mailbox #72

beamends opened this issue Apr 18, 2023 · 5 comments
Assignees
Milestone

Comments

@beamends
Copy link

Hi - I'm using the pip installed latest version on Ubuntu. i've just taken my first full backup and im trying to restore it to a different (new) gmail account. I've got the creds etc for both.

I'm attempting to do the restore using the following command:

gwbackupy --credentials-filepath restore-account-creds.json --workdir /mnt/gmail gmail restore --restore-deleted --email test-backup@gmail.com --to-email test-recovery@gmail.com

I get the following output but nothing is restored.....am i doing something wrong?

thanks!

        INFO 2023-04-18 14:04:05,019 - Filter options: deleted
        INFO 2023-04-18 14:04:05,019 - Scanning backup storage...
        INFO 2023-04-18 14:04:10,497 - Stored items: 476545
        INFO 2023-04-18 14:04:10,497 - Loading labels...
        INFO 2023-04-18 14:04:10,695 - Labels loaded successfully (23)
        INFO 2023-04-18 14:04:10,695 - Getting labels from server (test-backup@gmail.com)
        INFO 2023-04-18 14:04:10,703 - file_cache is only supported with oauth2client<4.0.0
        INFO 2023-04-18 14:04:10,922 - Filtering messages...
        INFO 2023-04-18 14:04:12,848 - Number of potentially affected messages: 0
        INFO 2023-04-18 14:04:12,848 - Upload messages...
        INFO 2023-04-18 14:04:13,852 - Messages uploaded successfully
@kamarton kamarton self-assigned this Apr 18, 2023
@beamends
Copy link
Author

beamends commented Apr 18, 2023

PS. if i change the task to "--restore-missing" (i just noticed that option) - I get the following output

      INFO 2023-04-18 14:18:02,454 - Filter options: missing
      INFO 2023-04-18 14:18:02,455 - Scanning backup storage...
      INFO 2023-04-18 14:18:07,923 - Stored items: 476545
      INFO 2023-04-18 14:18:07,923 - Loading labels...
      INFO 2023-04-18 14:18:08,044 - Labels loaded successfully (23)
      INFO 2023-04-18 14:18:08,044 - Getting labels from server (test-backup@gmail.com)
      INFO 2023-04-18 14:18:08,049 - file_cache is only supported with oauth2client<4.0.0
      INFO 2023-04-18 14:18:08,260 - Filtering messages...
      INFO 2023-04-18 14:18:10,367 - Number of potentially affected messages: 238272
      INFO 2023-04-18 14:18:10,367 - Upload messages...
      INFO 2023-04-18 14:18:10,368 - 104aab753596579e Restoring message...
      INFO 2023-04-18 14:18:10,369 - 104a8d63e4dbd03e Restoring message...
      INFO 2023-04-18 14:18:10,369 - 104a8db2bbbbffb8 Restoring message...
      INFO 2023-04-18 14:18:10,370 - 104a8b534dcad747 Restoring message...
      ERROR 2023-04-18 14:18:10,370 - 104a8d63e4dbd03e Exception: Not implemented for different emails
      Traceback (most recent call last):
        File "/home/russ/.local/lib/python3.8/site-packages/gwbackupy/gmail.py", line 453, in __restore_message
          label_ids = self.__get_restore_label_ids(
        File "/home/russ/.local/lib/python3.8/site-packages/gwbackupy/gmail.py", line 374, in __get_restore_label_ids
          raise NotImplementedError("Not implemented for different emails")
      NotImplementedError: Not implemented for different emails
      INFO 2023-04-18 14:18:10,371 - 104a95fc5b5a2356 Restoring message...
      ERROR 2023-04-18 14:18:10,382 - 104aab753596579e Exception: Not implemented for different emails
      Traceback (most recent call last):
        File "/home/russ/.local/lib/python3.8/site-packages/gwbackupy/gmail.py", line 453, in __restore_message
          label_ids = self.__get_restore_label_ids(
        File "/home/russ/.local/lib/python3.8/site-packages/gwbackupy/gmail.py", line 374, in __get_restore_label_ids
          raise NotImplementedError("Not implemented for different emails")
      NotImplementedError: Not implemented for different emails
      ERROR 2023-04-18 14:18:10,392 - 104a8db2bbbbffb8 Exception: Not implemented for different emails
      Traceback (most recent call last):
        File "/home/russ/.local/lib/python3.8/site-packages/gwbackupy/gmail.py", line 453, in __restore_message
          label_ids = self.__get_restore_label_ids(
        File "/home/russ/.local/lib/python3.8/site-packages/gwbackupy/gmail.py", line 374, in __get_restore_label_ids
          raise NotImplementedError("Not implemented for different emails")
      NotImplementedError: Not implemented for different emails

@kamarton
Copy link
Contributor

What happen if remove --restore-deleted parameter?

gwbackupy --credentials-filepath restore-account-creds.json --workdir /mnt/gmail gmail restore --email test-backup@gmail.com --to-email test-recovery@gmail.com

@beamends
Copy link
Author

beamends commented Apr 18, 2023

gwbackupy --credentials-filepath restore-account-creds.json --workdir /mnt/gmail gmail restore
--email test-backup@gmail.com --to-email test-recovery@gmail.com
WARNING 2023-04-18 14:22:02,873 - Tasks not found, see more e.g. --restore-deleted

What happen if remove --restore-deleted parameter?

gwbackupy --credentials-filepath restore-account-creds.json --workdir /mnt/gmail gmail restore --email test-backup@gmail.com --to-email test-recovery@gmail.com

@kamarton kamarton added type:bug Something isn't working type:enhancement New feature or request type:Implement and removed type:bug Something isn't working labels Apr 18, 2023
@kamarton
Copy link
Contributor

@beamends if possible, please test it. Within a few days, the package will have a new release version.

pip3 uninstall gwbackupy
pip3 install https://github.com/smartondev/gwbackupy/archive/72-implement-and-fix-gmail-restore-to-another-account.zip

Use --restore-missing parameter to restore different account.

Please note that the issue #26 still persists, causing repeated restorations to result in redundant email restorations in the destination account.

@kamarton kamarton added this to the 0.11.0 milestone Apr 23, 2023
kamarton added a commit that referenced this issue Apr 25, 2023
…tore-to-another-account

enh: implement restore labels to another account #72
@kamarton
Copy link
Contributor

fixed in 0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@kamarton @beamends and others