Answers: <p>First of all you need to support HA mode. You will need:</p>
  
  <ol>
  <li>external MySQL DB (e.g. AWS RDS Aurora)</li>
  <li>external load balancer (e.g. AWS ELB)</li>
  <li>2 additional Rancher Server Nodes (to support quorum of 3)</li>
  </ol>
  
  <p>Once you will be ready with external DB Rancher would ask you to backup &amp; restore his database in it. After that you'll be asked to redeploy Rancher Server with additional params for external DB connection. Then you'll be able to run two more Rancher Server Nodes (e.g. using AWS ELB).</p>
  
  <p>When previous steps have finished you would be able to add more Rancher Agent Nodes in AWS directly from Rancher Hosts tab. After that you can just switch off OVH nodes - payload would be transferred to AWS automagically.</p>
  
  <p><strong>Make sure to backup &amp; restore all databases or data-sensitive instances on OVH hosts.</strong></p>
  
  <p>More information such as HA Requirements etc. can be found <a href="http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/#launching-rancher-server---full-activeactive-ha" rel="nofollow noreferrer">in documentation</a>.</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-01-17T13:43:31.627Z
Answers: Yes, HA is the path I'm goint to, but I didn't quite get how the info about configuration of stacks & etc will get from OVH Rancher servers into the AWS Rancher server. I can just stop & run an agent container on an OVH host with parameters to connect to AWS Rancher server, but the info on stacks & etc will be missing. I was thinking that I'll maybe have to dump certain mysql tables from OVH Rancher mysql servers & then import them to AWS Rancher server?
Answers: GTXBxaKgCANmT9D9
Answers: CC BY-SA 3.0
Answers: 2018-01-17T17:26:10.777Z
Answers: @ValeriiVainkop this depends on the type of Orchestration framework. But all of them would detect that host is failed and will try to restore the load on available resources. As part of HA switch you would have to backup MySQL DB from OVH server and restore it somewhere in AWS RDS (or any other HA database service).
Answers: Maksim
Answers: CC BY-SA 3.0
Answers: 2018-01-17T17:29:34.517Z
Answers: @ValeriiVainkop in HA mode all Rancher Server Nodes would share Database where current stack info is stored. So every node would be aware of overall structure of every environment.
Answers: Maksim
Answers: CC BY-SA 3.0
Answers: 2018-01-17T18:29:21.790Z
Answers: Orchestration framework is Cattle on all Rancher servers. The problem is that I have **4 different Rancher servers** with **4 separate mysql databases**.I did the following: stopped Rancher server & agent containers on OVH server. Started new agent container with parameters to connect to AWS Rancher server (taken from AWS's Infrastructure->Hosts->Add->Custom).And I saw a new host in AWS Rancher server UI->Hosts but it didn't have any Stack configs as they're stored in mysql on OVH. Of course Rancher server would know about configs if it stored it in one mysql, but I have a different situation.
Answers: GTXBxaKgCANmT9D9
Answers: CC BY-SA 3.0
Answers: 2018-01-17T18:40:31.263Z
Answers: That's why you need to switch to HA first. Do you have one Rancher server and multiple Hosts in it? Or separate Rancher servers? Independent. Nobody knows others.
Answers: Maksim
Answers: CC BY-SA 3.0
Answers: 2018-01-17T21:59:36.553Z
Answers: **4 defferent=separate Rancher servers** with one host on each of them (AWS:1 host, OVH:1 host, OVH2: 1 host) except the last one OVH3: 3 hosts on it. And I still see no need to switch to HA to solve my issue or am I missing smth?
Answers: GTXBxaKgCANmT9D9
Answers: CC BY-SA 3.0
Answers: 2018-01-18T04:45:24.803Z
Answers: @ValeriiVainkop to switch from OVH to AWS using built in functionality you should switch to HA mode on each installation, transfer payload from one datacenter to another and then switch back to standalone mode. But has built in functionality for environments and the best approach would be to connect all servers into single cluster and move on with that. You can use Rancher Catalog to create stack templates and Rancher API to automate deployments.
Answers: Maksim
Answers: CC BY-SA 3.0
Answers: 2018-01-29T18:48:17.573Z
Answers: @ValeriiVainkop any progress on that? Have you successfully migrated your infrastructure?
Answers: Maksim
Answers: CC BY-SA 3.0
Answers: 2018-01-29T19:00:05.113Z
Answers: yes, but I had to recreate all environments on the new Rancher server by exporting/importing yml (download config from each stack. Btw crazy not to be able to download all stacks yml at once) & then made db dumps & restored them to appropriate db containers.
Answers: GTXBxaKgCANmT9D9
Answers: CC BY-SA 3.0
Answers: 2018-01-17T09:08:01.110Z
Answers: 2018-01-17T09:08:01.110Z
Answers: Maksim
Body: <p>I have 4 Rancher servers: one for each environment: dev, sandbox, staging &amp; prod.</p>
  
  <p>3 of them are of an older Rancher 1.4 version (sandbox, staging, prod) &amp; are hosted on OVH hosting, the one left (dev) is on thr latest 1.6.14 &amp; AWS.</p>
  
  <p>I need to move 3 hosts from OVH to AWS &amp; attach all of them to the only one aws Rancher server which already has 1 dev host.</p>
  
  <p>If I stop rancher-agent on one of OVH rancher hosts &amp; reconfigure it to point to aws, then it appears there in the console, but the config for stacks &amp; etc is lost, as it’s, probably, stored in mysql of the original rancher server.</p>
  
  <p>If I deploy a host from each of the OVH rancher servers to AWS, then I’m stuck with the same problem, after I switch the new hosts agents to the only aws rancher server the configurations for stacks &amp; etc will be lost.</p>
  
  <p>Please advise on the strategy to merge all that into single aws rancher server + 4 hosts: one for each environment. I’m trying not to recreate all 3 environments on aws manually, to avoid downtime &amp; a lot of manual work.</p>
  
  <p>Thanks!</p>
  
Tags: <docker><rancher><aws-vpc>
Title: Migrate Rancher host from server to server
UserDisplayName: GTXBxaKgCANmT9D9
ThreadText: # Migrate Rancher host from server to server
  
  (Asked by: username_0 on 2018-01-17)
  
  I have 4 Rancher servers: one for each environment: dev, sandbox, staging & prod.
  
  3 of them are of an older Rancher 1.4 version (sandbox, staging, prod) & are hosted on OVH hosting, the one left (dev) is on thr latest 1.6.14 & AWS.
  
  I need to move 3 hosts from OVH to AWS & attach all of them to the only one aws Rancher server which already has 1 dev host.
  
  If I stop rancher-agent on one of OVH rancher hosts & reconfigure it to point to aws, then it appears there in the console, but the config for stacks & etc is lost, as it’s, probably, stored in mysql of the original rancher server.
  
  If I deploy a host from each of the OVH rancher servers to AWS, then I’m stuck with the same problem, after I switch the new hosts agents to the only aws rancher server the configurations for stacks & etc will be lost.
  
  Please advise on the strategy to merge all that into single aws rancher server + 4 hosts: one for each environment. I’m trying not to recreate all 3 environments on aws manually, to avoid downtime & a lot of manual work.
  
  Thanks!
  
  **Tags:** docker, rancher, aws-vpc
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-01-17. Score: 1
  
  First of all you need to support HA mode. You will need:
  
  1. external MySQL DB (e.g. AWS RDS Aurora)
  2. external load balancer (e.g. AWS ELB)
  3. 2 additional Rancher Server Nodes (to support quorum of 3)
  
  Once you will be ready with external DB Rancher would ask you to backup & restore his database in it. After that you'll be asked to redeploy Rancher Server with additional params for external DB connection. Then you'll be able to run two more Rancher Server Nodes (e.g. using AWS ELB).
  
  When previous steps have finished you would be able to add more Rancher Agent Nodes in AWS directly from Rancher Hosts tab. After that you can just switch off OVH nodes - payload would be transferred to AWS automagically.
  
  **Make sure to backup & restore all databases or data-sensitive instances on OVH hosts.**
  
  More information such as HA Requirements etc. can be found [in documentation](http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/#launching-rancher-server---full-activeactive-ha).
  
  > **Comments:**
  > **username_0**: Yes, HA is the path I'm goint to, but I didn't quite get how the info about configuration of stacks & etc will get from OVH Rancher servers into the AWS Rancher server. I can just stop & run an agent container on an OVH host with parameters to connect to AWS Rancher server, but the info on stacks & etc will be missing. I was thinking that I'll maybe have to dump certain mysql tables from OVH Rancher mysql servers & then import them to AWS Rancher server?  
  > **username_1**: @ValeriiVainkop this depends on the type of Orchestration framework. But all of them would detect that host is failed and will try to restore the load on available resources. As part of HA switch you would have to backup MySQL DB from OVH server and restore it somewhere in AWS RDS (or any other HA database service).  
  > **username_1**: @ValeriiVainkop in HA mode all Rancher Server Nodes would share Database where current stack info is stored. So every node would be aware of overall structure of every environment.  
  > **username_0**: Orchestration framework is Cattle on all Rancher servers. The problem is that I have **4 different Rancher servers** with **4 separate mysql databases**.I did the following: stopped Rancher server & agent containers on OVH server. Started new agent container with parameters to connect to AWS Rancher server (taken from AWS's Infrastructure->Hosts->Add->Custom).And I saw a new host in AWS Rancher server UI->Hosts but it didn't have any Stack configs as they're stored in mysql on OVH. Of course Rancher server would know about configs if it stored it in one mysql, but I have a different situation.  
  > **username_1**: That's why you need to switch to HA first. Do you have one Rancher server and multiple Hosts in it? Or separate Rancher servers? Independent. Nobody knows others.  
  > **username_0**: **4 defferent=separate Rancher servers** with one host on each of them (AWS:1 host, OVH:1 host, OVH2: 1 host) except the last one OVH3: 3 hosts on it. And I still see no need to switch to HA to solve my issue or am I missing smth?  
  > **username_1**: @ValeriiVainkop to switch from OVH to AWS using built in functionality you should switch to HA mode on each installation, transfer payload from one datacenter to another and then switch back to standalone mode. But has built in functionality for environments and the best approach would be to connect all servers into single cluster and move on with that. You can use Rancher Catalog to create stack templates and Rancher API to automate deployments.  
  > **username_1**: @ValeriiVainkop any progress on that? Have you successfully migrated your infrastructure?  
  > **username_0**: yes, but I had to recreate all environments on the new Rancher server by exporting/importing yml (download config from each stack. Btw crazy not to be able to download all stacks yml at once) & then made db dumps & restored them to appropriate db containers.  
  
  ---
  
  