# Update sparse\_code.csv's

## First, backup everything!

Start by backing up the following three repositories

* [annotated\_cha](https://github.com/BergelsonLab/annot),
* [annotated\_opf](https://github.com/BergelsonLab/annotated_opf),
* [sparse\_code\_csvs](https://github.com/BergelsonLab/sparse_code_csvs).

For each of them, do the following:

* Clone them somewhere. It is ok to do a shallow clone.
* Each repository contains a `backup.py` script - run it.&#x20;
* If the script didn't finish successfully, look at the error messages - they might contain enough information for you to fix the problem. If that isn't so, slack the lab tech for help.
* DON'T SKIP THIS! Once the script has finished, check the repository for changes. Make sure that the changes are what you expect them to be. Actually do that, don't do `git add .` or `git commit -a` or anything of the sort. If there is something unexpected - deal with it first. Ask people about where these changes might have come from and why they haven't made it to the backup yet. Feel free to delegate this to the lab tech.
* Add, commit, push.
* Delete the folders you cloned the repositories to. We will need "sparse\_code\_csv" again later so you can keep that one. But you can also just clone it again later.

## Update sparse\_code.csv's

Depending on whether there have been changes to just a few annotation files or many, you can do them one by one (see [get-sparse\_code\_csv-for-one-file](https://gitbook.bergelsonlab.com/data-pipeline/basic-levels/update-sparse_code.csvs/get-sparse_code_csv-for-one-file "mention")) or all at the same time (see [individual-basic-level-files-sparse\_code-csvs](https://gitbook.bergelsonlab.com/data-pipeline/basic-levels/update-sparse_code.csvs/individual-basic-level-files-sparse_code-csvs "mention")). The latter takes longer because it runs on all recordings whether they have been updated or not.

## Last, backup sparse\_code.csv's

Follow instructions in [#first-backup-everything](#first-backup-everything "mention"), but only for the "sparse\_code\_csvs" repo.
