2015-03-25 16:09:49 +00:00
|
|
|
# NAME
|
|
|
|
|
|
|
|
git-annex migrate - switch data to different backend
|
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
|
|
|
git annex migrate `[path ...]`
|
|
|
|
|
2023-12-07 19:50:52 +00:00
|
|
|
git annex migrate --update
|
|
|
|
|
2015-03-25 16:09:49 +00:00
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
Changes the specified annexed files to use the default key-value backend
|
|
|
|
(or the one specified with `--backend`). Only files whose content
|
2023-12-07 22:00:09 +00:00
|
|
|
is currently present are migrated.
|
2015-03-25 16:09:49 +00:00
|
|
|
|
2023-12-07 22:00:09 +00:00
|
|
|
Note that the content is also still stored using the old keys after
|
|
|
|
migration. When possible, hard links are used to avoid that taking up
|
|
|
|
extra disk space. Use `git annex unused` to find and remove the old keys.
|
2015-03-25 16:09:49 +00:00
|
|
|
|
2023-12-08 18:18:18 +00:00
|
|
|
Normally, nothing will be done to specified files that are 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.
|
2015-03-25 16:09:49 +00:00
|
|
|
|
|
|
|
# OPTIONS
|
|
|
|
|
2023-12-07 19:50:52 +00:00
|
|
|
* `--update`
|
|
|
|
|
|
|
|
This updates the local repository for migrations that were performed
|
2023-12-08 17:23:03 +00:00
|
|
|
elsewhere. Only new migrations since the last time this was run will
|
|
|
|
be performed.
|
|
|
|
|
|
|
|
This does not modify the working tree, but only hard links
|
|
|
|
(or in some cases copies) annex objects to their new keys.
|
|
|
|
|
2023-12-08 18:18:18 +00:00
|
|
|
`git-annex pull` and `git-annex sync --content` automatically do this,
|
|
|
|
unless the `annex.syncmigrations` config is set to false.
|
|
|
|
|
2023-12-08 17:23:03 +00:00
|
|
|
Note that older versions of git-annex did not record migrations in a
|
|
|
|
way that this can use. Migrations performed with those older versions
|
|
|
|
had to be manually run in each clone of the repository.
|
|
|
|
|
|
|
|
* `--apply`
|
|
|
|
|
|
|
|
This applies all recorded migrations to the local repository. It is the
|
|
|
|
non-incremental form of `--update`.
|
|
|
|
|
|
|
|
One situation where this can be useful is when `git-annex migrate
|
|
|
|
--update` has been run, but since then un-migrated
|
|
|
|
objects have entered the repository. Using this option ensures that
|
|
|
|
any such objects get migrated.
|
2023-12-07 19:50:52 +00:00
|
|
|
|
|
|
|
Note that older versions of git-annex did not record migrations in a
|
|
|
|
way that this can use. Migrations performed with those older versions
|
|
|
|
had to be manually run in each clone of the repository.
|
|
|
|
|
2015-03-25 16:09:49 +00:00
|
|
|
* `--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.
|
|
|
|
|
2021-05-10 19:00:13 +00:00
|
|
|
* Also the [[git-annex-common-options]](1) can be used.
|
|
|
|
|
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 16:59:30 +00:00
|
|
|
* `--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
|
2024-03-01 21:03:40 +00:00
|
|
|
to keys in most migrations. With this option, the size information is
|
|
|
|
removed instead.
|
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 16:59:30 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-12-08 20:22:14 +00:00
|
|
|
To add back the size to an URL key, use this:
|
|
|
|
|
|
|
|
git-annex migrate --backend=URL somefile
|
|
|
|
|
2023-05-04 20:34:35 +00:00
|
|
|
* `--json`
|
|
|
|
|
|
|
|
Enable JSON output. This is intended to be parsed by programs that use
|
|
|
|
git-annex. Each line of output is a JSON object.
|
|
|
|
|
|
|
|
* `--json-error-messages`
|
|
|
|
|
|
|
|
Messages that would normally be output to standard error are included in
|
|
|
|
the JSON instead.
|
|
|
|
|
2015-03-25 16:09:49 +00:00
|
|
|
# SEE ALSO
|
|
|
|
|
|
|
|
[[git-annex]](1)
|
|
|
|
|
2015-05-29 16:12:55 +00:00
|
|
|
[[git-annex-upgrade]](1)
|
|
|
|
|
2022-09-26 19:59:10 +00:00
|
|
|
[[git-annex-backend]](1)
|
|
|
|
|
2015-03-25 16:09:49 +00:00
|
|
|
# AUTHOR
|
|
|
|
|
|
|
|
Joey Hess <id@joeyh.name>
|
|
|
|
|
|
|
|
Warning: Automatically converted into a man page by mdwn2man. Edit with care.
|