git-annex/doc/git-annex-migrate.mdwn
Joey Hess 51b73ea1fc
migrate: New --remove-size option
While intended for converting URL keys added by addurl --fast to be
as if added by addurl --relaxed, it can also be used to remove size
from other types of keys. Although that is not likely to be useful
for checksummed keys, I suppose it could be used for WORM or other
non-checksum keys.

Specifying the --remove-size option does not prevent other migrations
from taking effect if there's a key upgrade to perform, or if the
backend has changed. So --backend=URL needs to be used to prevent
migrating an URL key to the default backend.

Note that it's not possible to use git-annex migrate to convert from a
non-URL key to an URL key, as URL keys cannot be generated, except by
addurl. So while this can get the same effect as --relaxed would have
when addurl --fast was used, when --fast was not used, it won't work, or
if --backend=URL is not used will remove the size but not prevent
checksum verification, which is not useful. Due to this complexity, I
decided not to mention it in the git-annex addurl man page.

Sponsored-by: Jochen Bartl on Patreon
2021-11-12 13:28:28 -04:00

64 lines
1.7 KiB
Markdown

# NAME
git-annex migrate - switch data to different backend
# SYNOPSIS
git annex migrate `[path ...]`
# DESCRIPTION
Changes the specified annexed files to use the default key-value backend
(or the one specified with `--backend`). Only files whose content
is currently available are migrated.
Note that the content is also still available using the old key after
migration. Use `git annex unused` to find and remove the old key.
Normally, nothing will be done to files already using the new backend.
However, if a backend changes the information it uses to construct a key,
this can also be used to migrate files to use the new key format.
When you have multiple repositories that each contain a copy of a file,
it's best to run migrate in all of them.
# OPTIONS
* `--backend`
Specify the new key-value backend to use for migrated data.
* `--force`
Force migration of keys that are already using the new backend.
* file matching options
The [[git-annex-matching-options]](1)
can be used to specify files to migrate.
* Also the [[git-annex-common-options]](1) can be used.
* `--remove-size`
Keys often include the size of their content, which is generally a useful
thing. In fact, this command defaults to adding missing size information
to keys. With this option, the size information is removed instead.
One use of this option is to convert URL keys that were added
by `git-annex addurl --fast` to ones that would have been added if
that command was run with the `--relaxed` option. Eg:
git-annex migrate --remove-size --backend=URL somefile
# SEE ALSO
[[git-annex]](1)
[[git-annex-upgrade]](1)
# AUTHOR
Joey Hess <id@joeyh.name>
Warning: Automatically converted into a man page by mdwn2man. Edit with care.