# Cloning services between stacks

**URL:** <https://forums.suse.com/t/cloning-services-between-stacks/4576>\
**Category:** Rancher 1.x\
**Created:** [November 10, 2016, 8:18am UTC](https://forums.suse.com/t/cloning-services-between-stacks/4576 "2016-11-10T08:18:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![garjunan](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@garjunan](https://forums.suse.com/u/garjunan)\
**Post date:** [November 10, 2016, 8:18am UTC](https://forums.suse.com/t/cloning-services-between-stacks/4576/1 "2016-11-10T08:18:07Z")

</div>

Hi,

What is the best approach to clone/copy a service from one stack to another existing stack. We can take yaml export and import if we are creating new stack. How do we do it on existing stack. It is very difficult to create a same service again on another stack manually with lot of aliases, environment variables.

Please suggest the best approach to do this.

Thanks  
Gokul

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [November 10, 2016, 10:15pm UTC](https://forums.suse.com/t/cloning-services-between-stacks/4576/2 "2016-11-10T22:15:31Z")

</div>

It sounds as if you want to clone services into the same stack.

Option 1: Clone individual services using the UI  
Option 2: Export the yaml, use rancher-compose or our CLI to launch into the same stack by using `-p <stackname>` to have the services into the same stack. You’d need to update the services name so there is no conflic.t

---

<div class="post-metadata">

**Author:** ![garjunan](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@garjunan](https://forums.suse.com/u/garjunan)\
**Post date:** [November 12, 2016, 9:34am UTC](https://forums.suse.com/t/cloning-services-between-stacks/4576/3 "2016-11-12T09:34:02Z")

</div>

@denise

I am not looking into same stack. I am using clone option from UI to create it on same stack. I am looking to create a copy of service to another stack.

Example:

Stack1: service1, service2, service3  
Stack2: service4,service5, service6 which is running already and I want a copy of service1 from Stack1.

I am aware that we can create new stack from yaml but i wanted to create a copy of service in existing Stack.

---

<div class="post-metadata">

**Author:** ![garjunan](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@garjunan](https://forums.suse.com/u/garjunan)\
**Post date:** [November 17, 2016, 9:50am UTC](https://forums.suse.com/t/cloning-services-between-stacks/4576/4 "2016-11-17T09:50:42Z")

</div>

Hi,

Any update on this issue?

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [November 22, 2016, 3:26pm UTC](https://forums.suse.com/t/cloning-services-between-stacks/4576/5 "2016-11-22T15:26:06Z")

</div>

I understand what you’re trying to do. At this point, what you’re looking to do does not exist through the UI.

You could use the rancher-compose to do what you want. Copy the yaml for the service that you want to copy and then use.

So if you exported `service1` from Stack 1, you could run `rancher-compose -p Stack2 up` and it would place the service in Stack2.

Feel free to add an enhancement request in Github for being able to clone services across stacks in Rancher.
