# Old bam files not running in GATK or deeptools after moving files to new server

**URL:** <https://help.galaxyproject.org/t/old-bam-files-not-running-in-gatk-or-deeptools-after-moving-files-to-new-server/155>\
**Category:** Uncategorized\
**Tags:** devops-administration\
**Created:** [December 7, 2018, 3:39pm UTC](https://help.galaxyproject.org/t/old-bam-files-not-running-in-gatk-or-deeptools-after-moving-files-to-new-server/155 "2018-12-07T15:39:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsarro](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jsarro](https://help.galaxyproject.org/u/jsarro)\
**Post date:** [December 7, 2018, 3:39pm UTC](https://help.galaxyproject.org/t/old-bam-files-not-running-in-gatk-or-deeptools-after-moving-files-to-new-server/155/1 "2018-12-07T15:39:18Z")

</div>

HI,

We just recently moved all of our Galaxy data to a new server with python 2.7 so that we could upgrade to the latest version of galaxy. Everything seems to be working pretty well except that when I try to re-run old GATK or deeptools tasks, the job fails.

**I have checked/compared “moved data” versus “re-uploaded data” using these two methods:**

1. **moved bam data: job errors** : checked file locations to make sure they match, checked permissions, run jobs with new data (error)
2. **re-uploaded" bam data: job success** : copied data (from the new server to my local machine) and re-uploaded them. Jobs run successfully with this data creating the same output as the old jobs

I am wondering if anyone might know why this is happening `with method 1`. There does not seem to be anything wrong with the bam files or the tools.

Any ideas would be great, thanks!

#### Below are the errors output by some of the tools after BAM were only moved (not re-uploaded) `using method 1`

_Deeptools bam compare output_

```
Fatal error: Exit code 1 ()
The file one.bam does not exist

```

_GATK haplotype caller_

```
##### ERROR MESSAGE: File /data/galaxy/tmp/tmp-gatk-PBNEqR/gatk_input_0.bam.bai 
is malformed: Premature end-of-file while reading BAM index file /data/galaxy/tmp/tmp-gatk-
PBNEqR/gatk_input_0.bam.bai. 
It's likely that this file is truncated or corrupt -- 
Please try re-indexing the corresponding BAM file.

```

_Indel realigner_

```
##### ERROR MESSAGE: File /data/galaxy/tmp/tmp-gatk-tXbYgP/gatk_input.bam.bai is malformed: 
Premature end-of-file while reading BAM index file /data/galaxy/tmp/tmp-gatk-tXbYgP/gatk_input.bam.bai. 
It's likely that this file is truncated or corrupt -- 
Please try re-indexing the corresponding BAM file.

```

* * *

> Note: Moderator reformatted post for clarity

---

<div class="post-metadata">

**Author:** ![jsarro](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jsarro](https://help.galaxyproject.org/u/jsarro)\
**Post date:** [December 14, 2018, 3:44pm UTC](https://help.galaxyproject.org/t/old-bam-files-not-running-in-gatk-or-deeptools-after-moving-files-to-new-server/155/2 "2018-12-14T15:44:54Z")

</div>

Update\* I have located the bam indexes on our original server and discovered that the \_metadata files (containing the indexes) in the files dir were not copied over with the rest of the files. Copying these files over has fixed this issue.

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [December 14, 2018, 5:42pm UTC](https://help.galaxyproject.org/t/old-bam-files-not-running-in-gatk-or-deeptools-after-moving-files-to-new-server/155/3 "2018-12-14T17:42:08Z")

</div>

Great, glad you found the problem and thanks for posting back the solution!
