anvi-migrate

Migrates any anvi'o artifact, whether it is a database or a config file, to a newer version. Pure magic..

🔙 To the main page of anvi’o programs and artifacts.

Authors

Requires

contigs-db

Can use

profile-db pan-db genes-db genomes-storage-db structure-db modules-db workflow-config

Provides

This program does not seem to provide any artifacts. Such programs usually print out some information for you to see or alter some anvi’o artifacts without producing any immediate outputs.

Usage

This is a multi-talented program that seamlessly updates any anvi’o artifact (i.e., anvi’o databases or config files) to its latest version.

You can provide one or more files and the program will migrate all. However, you must choose whether to migrate the databases safely, or quickly.

If you choose to migrate safely, anvi’o will first make a copy of each file and save it as a backup. In case something goes wrong during the migration, it let you know what happened and will restore your original file from its copy. In the case of a successful migration, the old copy will go away gracefully (and quietly).

This is how you migrate safely:

anvi-migrate --migrate-safely *.db

Of course, we will always suggest that migrating safely is better, because fewer people get angry at us when we do that. In practice though, making those backup copies takes up extra time and it is unlikely that the migration will fail anyway, so if you have a lot of databases to migrate and are okay with a bit of risk, you have the option to migrate quickly instead. In this case, anvi’o will not copy your databases before starting the migration.

anvi-migrate --migrate-quickly *.db

Please remember that by living life in the fast lane, you forego your safety net. On the rare occasion that the migration does fail, this program will let you know what happened, leave you with a database that has a .broken file extension. In this unlikely event, you can always reach out to us.

Migrating to a specific version

If your database is a few versions behind the highest available version but for whatever reason you don’t want to migrate it all the way, you can specify which version to update your database to. Just use the -t flag (note: migrating with this parameter only works on ONE database at a time):

anvi-migrate --migrate-safely -t 15 CONTIGS.db

Then anvi’o will update your database until it is whatever version you specified and stop. Of course, you cannot provide a version number that is higher than the highest available version. Nor can you provide a number that is lower than your database’s current version (ie, backwards migration is not possible).

Not sure what your database’s current version is? Try anvi-db-info.

You can always run anvi-migrate -v to learn about the versions of artifact types your anvi’o installation can work with.

Edit this file to update this information.

Command line interface

The following is the list of parameters and their descriptions in the latest version of anvi-migrate.

The code that generates this web page ensures that this information is the latest available in 9-dev (eunice). Which means, in some cases the information in this section (generated automatically) might be more comprehensive or up-to-date compared to the descriptions above (written by humans).


Command line usage

anvi-migrate [-h] [--migrate-safely] [--migrate-quickly] [--just-do-it] [-t VERSION] FILE(S) [FILE(S) ...]

Parameters and their descriptions

INPUTS You will literally give us anything.
FILE(S) required
One or more files to migrate. If you unleash the program on many files by running something like `anvi-migrate *.db *.json`, anvi'o will try to migrate all of the files that match to your filters.
SAFETY It is up to you. Safe things take much longer and boring. Unsafe things are fast, fun, and .. well, don't come to us if your computer loses power or something.
--migrate-safely
If you chose this, anvi'o will first create a copy of your input file, and if something goes wrong, it will restore the original. If everything works fine, it will remove the copy. IF YOU HAVE ANVI'O ARTIFACTS THAT ARE VERY LARGE OR IF YOU ARE MIGRATING MANY MANY OF THEM, THIS OPTION WILL ADD A HUGE I/O BURDEN ON YOUR SYSTEM :/ But still. Safety is safe.
--migrate-quickly
If you chose this, anvi'o will migrate your artifats in place. It will be much faster (and arguably more fun since #YOLO) than the safe option, but if something goes wrong, you will lose data. During the first five years of anvi'o development not, a single user lost data using our migration scripts as far as we know. But there is always a first, and today might be your lucky day.
PARAMETERS OF CONVENIENCE This is how anvi'o spoils you.
--just-do-it
Don't bother me with questions or warnings, just do it.
-t, --target-version VERSION
Anvi'o will stop upgrading your database when it reaches to this version.

Additional Resources

Are you aware of resources that may help users better understand the utility of this program? Please feel free to edit this file on GitHub. If you are not sure how to do that, find the __resources__ tag in this file to see an example.