Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinab25 authored Mar 16, 2018
1 parent 0d31234 commit 73feb85
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,34 @@ Bring the `file` on client:
$ docker exec -it rsync_client sh
$ rsync -e 'ssh -p 2222' -avz [email protected]:/data/ /data/
$ ls -l /data/
### Rsync data between containers in Rancher

0. Request TCP access to port 2222 to an accessible server of environment of the new installation from the source container host server.

1. Start **rsync client** on host from where do you want to migrate data (ex. production).

Infrastructures -> Hosts -> Add Container
* Select image: eeacms/rsync
* Command: sh
* Volumes -> Volumes from: Select source container

2. Open logs from container, copy the ssh key from the message

2. Start **rsync server** on host from where do you want to migrate data (ex. devel). The destination container should be temporarily moved to an accessible server ( if it's not on one ) .

Infrastructures -> Hosts -> Add Container
* Select image: eeacms/rsync
* Port map -> +(add) : 2222:22
* Command: server
* Add environment variable: SSH_AUTH_KEY="<SSH-KEY-FROM-R-CLIENT-ABOVE>"
* Volumes -> Volumes from: Select destination container


3. Within **rsync client** container from step 1 run:

```
$ rsync -e 'ssh -p 2222' -avz <SOURCE_DUMP_LOCATION> root@<TARGET_HOST_IP_ON_DEVEL>:<DESTINATION_LOCATION>
```

4. The rsync servers can be deleted, and the destination container can be moved back ( if needed )

0 comments on commit 73feb85

Please sign in to comment.