This repository was archived by the owner on Mar 18, 2021. It is now read-only.
forked from eea/eea.docker.rsync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d31234
commit 73feb85
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 ) |