Skip to content

Commit 25136f0

Browse files
committed
Document the copy command as replacement for migrate and mirror
1 parent c099193 commit 25136f0

File tree

5 files changed

+51
-6
lines changed

5 files changed

+51
-6
lines changed

.github/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ There are two types of backups:
2727

2828
# What You Can Do with a Backup
2929

30-
* Migrate - use the local copy to populate emails on another account. This is a once-only action that deletes any existing emails on the destination account.
31-
* Mirror - make a destination account match the local copy. This action can be repeated.
30+
* Copy - copy messages from one account to another, tracking copies in order to avoid duplicates.
3231
* Restore - push the local copy back to the original account.
3332

3433
See below for a [full list of commands](#commands).
@@ -145,13 +144,12 @@ and exported via [`utils export-to-thunderbird`](/docs/commands/utils-export-to-
145144
# Commands
146145

147146
* [`backup`](/docs/commands/backup.md)
147+
* [`copy`](/docs/commands/copy.md)
148148
* [`local accounts`](/docs/commands/local-accounts.md)
149149
* [`local check`](/docs/commands/local-check.md)
150150
* [`local folders`](/docs/commands/local-folders.md)
151151
* [`local list`](/docs/commands/local-list.md)
152152
* [`local show`](/docs/commands/local-show.md)
153-
* [`migrate`](/docs/commands/migrate.md)
154-
* [`mirror`](/docs/commands/mirror.md)
155153
* [`remote folders`](/docs/commands/remote-folders.md)
156154
* [`restore`](/docs/commands/restore.md)
157155
* [`setup`](/docs/commands/setup.md)

docs/commands/copy.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!--
2+
# @title command: 'copy'
3+
-->
4+
# Copy
5+
6+
```sh
7+
imap-backup copy SOURCE_EMAIL DESTINATION_EMAIL
8+
```
9+
10+
This command makes a local copy of the emails in the source account
11+
and then copies them to the destination account.
12+
13+
Exactly which folders are backed up (and copied) depends on how the account is set up.
14+
15+
Specifically, the `folder inclusion mode (whitelist/blacklist)` and
16+
`folders to include/exclude` list.
17+
18+
Note that, any messages on the destination account that is not on the source account
19+
are left unchanged.
20+
21+
# Options
22+
23+
* `--source-delimiter` - the separator between the elements of folders names
24+
on the source server, defaults to `/`,
25+
* `--source-prefix` - optionally, a prefix element to remove from the name
26+
of source folders,
27+
* `--destination-delimiter` - the separator between the elements of folder
28+
names on the destination server, defaults to `/`,
29+
* `--destination-prefix` - optionally, a prefix element to add before names
30+
on the destination server,
31+
* `--automatic-namespaces` - works out the 4 parameters above by querying
32+
the source and destination IMAP servers.
33+
34+
# Delimiters and Prefixes
35+
36+
For details of the delimiter and prefix options,
37+
see [the note about delimiters and prefixes](../delimiters-and-prefixes.md).

docs/commands/migrate.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
imap-backup migrate SOURCE_EMAIL DESTINATION_EMAIL [OPTIONS]
88
```
99

10+
This command is deprecated and will be removed in a future version. Use [copy](./copy.md).
11+
1012
This command copies backed up emails for one account (the "source")
1113
to another account (the "destination").
1214

docs/commands/mirror.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
imap-backup mirror SOURCE_EMAIL DESTINATION_EMAIL
88
```
99

10+
This command is deprecated and will be removed in a future version. Use [copy](./copy.md).
11+
1012
This command makes a local copy of the emails in the source account
1113
and then copies them to the destination account.
1214

lib/imap/backup/cli.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,12 @@ def copy(source_email, destination_email)
162162

163163
desc(
164164
"migrate SOURCE_EMAIL DESTINATION_EMAIL [OPTIONS]",
165-
"Uploads backed-up emails from account SOURCE_EMAIL to account DESTINATION_EMAIL"
165+
"(Deprecated) Uploads backed-up emails from account SOURCE_EMAIL to account DESTINATION_EMAIL"
166166
)
167167
long_desc <<~DESC
168+
This command is deprecated and will be removed in a future version.
169+
Use 'copy' instead.
170+
168171
All emails which have been backed up for the "source account" (SOURCE_EMAIL) are
169172
uploaded to the "destination account" (DESTINATION_EMAIL).
170173
@@ -221,9 +224,12 @@ def migrate(source_email, destination_email)
221224

222225
desc(
223226
"mirror SOURCE_EMAIL DESTINATION_EMAIL [OPTIONS]",
224-
"Keeps the DESTINATION_EMAIL account aligned with the SOURCE_EMAIL account"
227+
"(Deprecated) Keeps the DESTINATION_EMAIL account aligned with the SOURCE_EMAIL account"
225228
)
226229
long_desc <<~DESC
230+
This command is deprecated and will be removed in a future version.
231+
Use 'copy' instead.
232+
227233
This command updates the DESTINATION_EMAIL account's folders to have the same contents
228234
as those on the SOURCE_EMAIL account.
229235

0 commit comments

Comments
 (0)