2015-06-03 14:27:23 +00:00
|
|
|
[[!toc levels=3]]
|
2015-06-03 14:24:28 +00:00
|
|
|
|
|
|
|
# Software upgrades
|
|
|
|
|
2015-10-14 17:44:20 +00:00
|
|
|
Upgrading the code base of git-annex will be done differently depending on
|
|
|
|
your [[install]] method. For most distribution-based packages, it is
|
|
|
|
handled by the package management software.
|
2015-06-03 14:24:28 +00:00
|
|
|
|
2015-10-14 17:44:20 +00:00
|
|
|
For the standalone distribution, the [[git-annex-webapp]](1) will ask the
|
|
|
|
user for confirmation when it detects a new version. Once that is
|
|
|
|
confirmed, or if `annex.autoupgrade` is enabled (see the [[git-annex]](1)
|
|
|
|
manpage) the assistant will start the upgrade. The upgrade process is
|
|
|
|
fairly simple: the assistant will move the `git-annex.linux` directory out
|
|
|
|
of the way and replace it with the new version, then re-execute itself. It
|
|
|
|
therefore needs write access to the parent directory of the
|
|
|
|
`git-annex.linux` directory.
|
2015-06-03 14:24:28 +00:00
|
|
|
|
2015-10-14 17:44:20 +00:00
|
|
|
Note that "upgrading" from a distribution-based package to the
|
|
|
|
[[install/Linux_standalone/]] version may cause weird problems, as an
|
|
|
|
unexpected version of git-annex (e.g. the old one from packages) may be
|
2018-06-15 21:53:37 +00:00
|
|
|
ran.
|
2015-06-03 14:24:28 +00:00
|
|
|
|
|
|
|
# Repository upgrades
|
|
|
|
|
2015-04-17 14:42:16 +00:00
|
|
|
Occasionally improvements are made to how git-annex stores its data,
|
2011-03-16 19:51:42 +00:00
|
|
|
that require an upgrade process to convert repositories made with an older
|
|
|
|
version to be used by a newer version. It's annoying, it should happen
|
|
|
|
rarely, but sometimes, it's worth it.
|
|
|
|
|
2015-04-17 14:42:16 +00:00
|
|
|
There's a commitment that git-annex will always support upgrades from all
|
2011-03-16 19:51:42 +00:00
|
|
|
past versions. After all, you may have offline drives from an earlier
|
|
|
|
git-annex, and might want to use them with a newer git-annex.
|
|
|
|
|
2011-03-19 22:33:39 +00:00
|
|
|
git-annex will notice if it is run in a repository that
|
2019-09-13 16:58:58 +00:00
|
|
|
needs an upgrade, and either automatically upgrade it or
|
2019-09-13 16:26:26 +00:00
|
|
|
refuse to do anything. To upgrade, use the "git annex upgrade" command.
|
|
|
|
|
|
|
|
To prevent automatic upgrades in a repository, run:
|
2019-09-13 16:57:31 +00:00
|
|
|
`git config annex.autoupgraderepository false`
|
2011-03-16 19:51:42 +00:00
|
|
|
|
|
|
|
The upgrade process is guaranteed to be conflict-free. Unless you
|
|
|
|
already have git conflicts in your repository or between repositories.
|
|
|
|
Upgrading a repository with conflicts is not recommended; resolve the
|
|
|
|
conflicts first before upgrading git-annex.
|
|
|
|
|
2016-10-05 20:29:32 +00:00
|
|
|
The upgrade process needs to write to the repository. If the original
|
|
|
|
repository cannot be written to (due to eg being on readonly media),
|
|
|
|
the upgrade would need to be run in a copy of the repository.
|
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
The upgrade events, so far:
|
2011-03-16 19:51:42 +00:00
|
|
|
|
2018-10-25 21:23:53 +00:00
|
|
|
## v6 -> v7 (git-annex version 7.x)
|
2015-12-04 20:14:48 +00:00
|
|
|
|
2018-10-25 21:23:53 +00:00
|
|
|
v6 repositories are automatically upgraded to v7.
|
|
|
|
|
|
|
|
The only difference between v6 and v7 is that some additional git hooks
|
2018-12-05 16:22:36 +00:00
|
|
|
were added in v7. See below for details about what's new in v6/v7.
|
2018-10-25 21:23:53 +00:00
|
|
|
|
|
|
|
## v5 -> v6 (git-annex version 6.x)
|
|
|
|
|
2019-08-30 17:54:57 +00:00
|
|
|
v5 repositories are automatically upgraded to v6.
|
|
|
|
|
2016-04-04 17:17:24 +00:00
|
|
|
A v6 git-annex repository can have some files locked while other files are
|
2015-12-04 21:57:15 +00:00
|
|
|
unlocked, and all git and git-annex commands can be used on both locked and
|
2018-12-05 16:22:36 +00:00
|
|
|
unlocked files. It's a good idea to make sure that all users of the
|
|
|
|
repository have upgraded git-annex and upgraded their repositories
|
|
|
|
to the new version before starting to use this feature, since old
|
|
|
|
versions of git-annex will ignore the new unlocked files.
|
2016-04-04 17:17:24 +00:00
|
|
|
|
|
|
|
Direct mode repositories are upgraded to instead use the new
|
|
|
|
[[adjusted branches feature|git-annex-adjust]], which transparently unlocks
|
|
|
|
all locked files in the local repository.
|
2015-12-04 21:57:15 +00:00
|
|
|
|
|
|
|
The behavior of some commands changes in an upgraded repository:
|
|
|
|
|
2019-10-24 17:50:44 +00:00
|
|
|
* `When `annex.largefiles` is configured, git add` will add matching
|
|
|
|
files to the annex, rather than adding them directly to the git
|
|
|
|
repository.
|
2015-12-04 21:57:15 +00:00
|
|
|
|
|
|
|
* `git annex unlock` and `git annex lock` change how the pointer to
|
2018-12-05 16:22:36 +00:00
|
|
|
the annexed content is stored in git. If you commit the change,
|
|
|
|
that will impact all clones of the repository. This means all clones of the
|
|
|
|
repository will need to run at least v6 to correctly synchronise.
|
2018-12-04 21:07:11 +00:00
|
|
|
|
2016-04-04 17:17:24 +00:00
|
|
|
There is also a new `annex.thin` setting, which makes unlocked files in v6
|
|
|
|
repositories be hard linked to their content, instead of a copy. This saves
|
|
|
|
disk space but means any modification of an unlocked file will lose the
|
|
|
|
local (and possibly only) copy of the old version. This is automatically
|
|
|
|
enabled when upgrading a direct mode repository, since direct mode made the
|
|
|
|
same tradeoff.
|
2015-12-04 20:14:48 +00:00
|
|
|
|
2016-04-04 17:17:24 +00:00
|
|
|
See [[tips/unlocked_files/]] for more details about locked files and thin
|
|
|
|
mode.
|
2016-01-14 21:21:36 +00:00
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
## v4 -> v5 (git-annex version 5.x)
|
2013-11-05 20:42:59 +00:00
|
|
|
|
2013-12-29 19:01:46 +00:00
|
|
|
The upgrade from v4 to v5 is handled
|
|
|
|
automatically, and only affects [[direct mode]] repositories.
|
2013-11-05 20:42:59 +00:00
|
|
|
|
|
|
|
This upgrade involves changing direct mode repositories to operate with
|
|
|
|
core.bare=true.
|
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
## v3 -> v4 (git-annex version 4.x)
|
2013-02-26 19:13:10 +00:00
|
|
|
|
2013-11-05 20:42:59 +00:00
|
|
|
v4 was only used for [[direct_mode]], to ensure that a version of git-annex
|
|
|
|
that understands direct mode was used with a direct mode repository.
|
2013-02-26 19:13:10 +00:00
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
## v2 -> v3 (git-annex version 3.x)
|
2011-03-16 19:51:42 +00:00
|
|
|
|
2011-06-23 06:30:20 +00:00
|
|
|
Involved moving the .git-annex/ directory into a separate git-annex branch.
|
2011-03-16 19:51:42 +00:00
|
|
|
|
2011-06-30 20:16:52 +00:00
|
|
|
After this upgrade, you should make sure you include the git-annex branch
|
|
|
|
when git pushing and pulling.
|
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
### tips for this upgrade
|
2011-03-16 19:51:42 +00:00
|
|
|
|
2011-06-23 15:46:55 +00:00
|
|
|
This upgrade is easier (and faster!) than the previous upgrades.
|
|
|
|
You don't need to upgrade every repository at once; it's sufficient
|
|
|
|
to upgrade each repository only when you next use it.
|
2011-06-23 06:30:20 +00:00
|
|
|
|
2011-06-23 18:49:21 +00:00
|
|
|
Example upgrade process:
|
2011-06-23 06:30:20 +00:00
|
|
|
|
2011-06-23 18:49:21 +00:00
|
|
|
cd localrepo
|
|
|
|
git pull
|
|
|
|
git annex upgrade
|
|
|
|
git commit -m "upgrade v2 to v3"
|
|
|
|
git gc
|
2011-06-23 16:11:03 +00:00
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
## v1 -> v2 (git-annex version 0.20110316)
|
2011-03-16 19:51:42 +00:00
|
|
|
|
|
|
|
Involved adding hashing to .git/annex/ and changing the names of all keys.
|
|
|
|
Symlinks changed.
|
|
|
|
|
|
|
|
Also, hashing was added to location log files in .git-annex/.
|
|
|
|
And .gitattributes needed to have another line added to it.
|
|
|
|
|
2011-03-22 22:50:36 +00:00
|
|
|
Previously, files added to the SHA [[backends]] did not have their file
|
|
|
|
size tracked, while files added to the WORM backend did. Files added to
|
|
|
|
the SHA backends after the conversion will have their file size tracked,
|
2011-03-23 21:57:10 +00:00
|
|
|
and that information will be used by git-annex for disk free space checking.
|
|
|
|
To ensure that information is available for all your annexed files, see
|
|
|
|
[[upgrades/SHA_size]].
|
2011-03-22 22:50:36 +00:00
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
### tips for this upgrade
|
2011-06-23 06:30:20 +00:00
|
|
|
|
2011-06-23 15:46:55 +00:00
|
|
|
This upgrade can tend to take a while, if you have a lot of files.
|
|
|
|
|
2011-06-23 06:30:20 +00:00
|
|
|
Each clone of a repository should be individually upgraded.
|
|
|
|
Until a repository's remotes have been upgraded, git-annex
|
|
|
|
will refuse to communicate with them.
|
|
|
|
|
|
|
|
Start by upgrading one repository, and then you can commit
|
|
|
|
the changes git-annex staged during upgrade, and push them out to other
|
|
|
|
repositories. And then upgrade those other repositories. Doing it this
|
|
|
|
way avoids git-annex doing some duplicate work during the upgrade.
|
|
|
|
|
|
|
|
Example upgrade process:
|
|
|
|
|
|
|
|
cd localrepo
|
|
|
|
git pull
|
|
|
|
git annex upgrade
|
|
|
|
git commit -m "upgrade v1 to v2"
|
|
|
|
git push
|
|
|
|
|
|
|
|
ssh remote
|
|
|
|
cd remoterepo
|
|
|
|
git pull
|
|
|
|
git annex upgrade
|
|
|
|
...
|
|
|
|
|
2015-06-03 14:28:58 +00:00
|
|
|
## v0 -> v1 (git-annex version 0.04)
|
2011-03-16 19:51:42 +00:00
|
|
|
|
2011-03-17 11:20:55 +00:00
|
|
|
Involved a reorganisation of the layout of .git/annex/. Symlinks changed.
|
2011-03-16 19:51:42 +00:00
|
|
|
|
|
|
|
Handled more or less transparently, although git-annex was just 2 weeks
|
|
|
|
old at the time, and had few users other than Joey.
|
|
|
|
|
2011-07-08 05:26:18 +00:00
|
|
|
Before doing this upgrade, set annex.version:
|
|
|
|
|
|
|
|
git config annex.version 0
|