joeyates / imap-backup

Backup and Migrate IMAP Email Accounts
MIT License
1.37k stars 75 forks source link

[Question] How to migrate to a sub-folder? #160

Closed jxmesth closed 1 year ago

jxmesth commented 1 year ago

This is just a continuation of #159 as it was closed.

Hi @joeyates, apologies for the late reply. I've just gotten round to testing this and apparently I can't get this to work.

When I run the namespace command: imap-backup namespace me@google.co.uk

I get: Could not find command "namespace".

In addition to this, I just wanted to clarify what you mentioned above. To migrate all emails (folders and sub-folders) from me@google.co.uk to new-me@google.co.uk/me@google.co.uk, I need to run this: imap-backup migrate me@google.co.uk new-me@google.co.uk --source-prefix=new-me@google.co.uk --source-delimiter=.

If I'm not mistaken this should make a folder in my new-me@google.co.uk email called me@google.co.uk that contains sub-folders - Inbox, Sent, Drafts, etc. from my me@google.co.uk email.

So ideally running this command would give me this:

new-me@google.co.uk/
├─ Inbox/
├─ Sent/
├─ Deleted/
├─ me@google.co.uk/
│  ├─ Inbox/
│  ├─ Sent/
│  ├─ Deleted/

Thanks again.

joeyates commented 1 year ago

Hi @jxmesth

I'm afraid there was a typo in my reply to #159, the command to use for namespaces is

imap-backup namespaces me@google.co.uk

With GMail accounts, that should get you the following response:

Name       Prefix     Delimiter
personal   ""         "/"
other      (Not defined)
shared     (Not defined)

/ is the default delimiter, so you won't need to add a parameter to indicate it.

So, with that info, I think your migration command should be the following:

imap-backup migrate me@google.co.uk new-me@google.co.uk --destination-prefix=me@google.co.uk
huzaifaahmed commented 1 year ago

HI @joeyates,

Still gives the same error:

image

I wonder why this is. Am I doing something wrong here?

joeyates commented 1 year ago

Sorry that was a typo.

The correct command is

imap-backup remote namespaces me@google.co.uk
huzaifaahmed commented 1 year ago

Hi @joeyates, thanks for the reply. I've tried that and it works. However, I'm unable to get the migrate command to work when using it with the --destination-prefix option. It just exits, doesn't return anything. I've also tried using --verbose but that doesn't return anything either. Any idea what could be wrong? :/

joeyates commented 1 year ago

Hi @huzaifaahmed

Currently, you'll get no output if there is nothing backed up from the source account.

I suspect that this may be your situation.

What output do you get for this?

imap-backup local folders [YOUR SOURCE EMAIL ADDRESS]
joeyates commented 1 year ago

Closing due to inactivity