ae72df8aabc0b9c85a3a22c32f0f68a1497c02aa
[arvados.git] / doc / user / topics / arv-copy.html.textile.liquid
1 ---
2 layout: default
3 navsection: userguide
4 title: "How arv-copy works"
5 ...
6
7
8 This tutorial describes how to copy Arvados objects from one cluster to another by using @arv-copy@.
9
10 {% include 'tutorial_expectations' %}
11
12 Also note that they must work from a machine with an SSH key that is allowed to access both clusters (required to copy git repositories).
13
14 h2. Arv-copy
15
16 @arv-copy@ allows users to copy collections, pipeline templates, and pipeline instances, including all their dependencies from one cluster to another.
17
18 Suppose we want to copy from one cloud cluster to another. For example cluster "one" to cluster "two". The names "one" and "two" are interchangable with any cluster name.
19
20 First we have to make configuration files for both clusters.
21
22 <notextile>
23 <pre><code>~$ <span class="userinput">cd ~/.config/arvados</span>
24 ~$ <span class="userinput">echo "ARVADOS_API_HOST=one.arvadosapi.com" >> one.conf</span>
25 ~$ <span class="userinput">echo "ARVADOS_API_TOKEN=123456789abcdefghijkl" >> one.conf</span>
26 ~$ <span class="userinput">echo "ARVADOS_API_HOST=two.arvadosapi.com" >> two.conf</span>
27 ~$ <span class="userinput">echo "ARVADOS_API_TOKEN=987654321lkjihgfedcba" >> two.conf</span>
28 </code></pre>
29 </notextile>
30
31 Your ARVADOS_API_TOKEN can be found in the manage accounts page in Workbench under Current Token.
32
33 Once you have your config files ready, you can start copying!
34
35 Here are some examples:
36
37 h3. How to copy a collection
38
39 First, copy the uuid of the collection you want to copy from the cluster you want to copy from. The uuid can be found inside of a collection in the top left box, or from the URL bar (the part after @collections/...@)
40
41 Now copy the collection from cluster one to cluster two. We will use the uuid one-4zz18-1234567890abcde as an example.
42 <notextile>
43 <pre><code>~$ <span class="userinput">arv-copy --src one --dst two one-4zz18-1234567890abcde</span>
44 </code></pre>
45 </notextile>
46
47 The output should be like this:
48
49 <notextile>
50 <pre><code>
51 one-4zz18-1234567890abcde: 100M / 100M 100.0% 
52 arvados.arv-copy[1234] INFO: Success: created copy with uuid two-4zz18-8765943210cdbae
53 </code></pre>
54 </notextile>
55
56 The collection will be placed in your home project in the destination cluster. If you want to place your collection inside of a pre-created project, you can specify the project you want it to be in using the tag @--project-uuid@
57
58 h3. How to copy a pipeline template or pipeline instance
59
60 When copying a pipeline template or pipeline instance recursively (copying all dependencies in the template/instance) you must have a git repository in the destination cluster.
61
62 If you do not have a repository created, you can follow the documentation here: (Point to #6014)
63
64 Once you have your repository created, you can copy your pipeline template/instance. We will use the uuid one-p5p6p-abcd123efghi45jkl as an example, and samplegitrepo/samplename.git as an example git repo.
65
66 <notextile>
67 <pre><code>~$ <span class="userinput">arv-copy --src one --dst two --dst-git-repo samplegitrepo/samplename.git one-p5p6p-abcd123efghi45jkl</span>
68 </code></pre>
69 </notextile>
70
71 New branches in the destination git repo will be created for each branch used in the pipeline template. For example, if your source branch was named branch_name, your new branch will be named git_git_one_arvadosapi_com_reponame_git_branch_name.