Add Scripts/Bash/Transfer Docker Containers.md
This commit is contained in:
15
Scripts/Bash/Transfer Docker Containers.md
Normal file
15
Scripts/Bash/Transfer Docker Containers.md
Normal file
@ -0,0 +1,15 @@
|
||||
**Purpose**:
|
||||
If you find that you need to migrate a container, along with any supporting files, permissions, etc from an old server to a new server, rsync helps make this as painless as possible.
|
||||
Be sure to perform the following steps to make sure that you can copy the container's files.
|
||||
|
||||
On the destination (new) server, the directory needs to exist and be writable via the person copying the data over SSH:
|
||||
```
|
||||
sudo mkdir -p /srv/containers/example
|
||||
sudo chmod 740 /srv/containers/example
|
||||
sudo chown nicole:nicole /srv/containers/example
|
||||
```
|
||||
|
||||
On the source (old) server, perform an rsync over to the new server, authenticating yourself as you will be prompted to do so:
|
||||
```
|
||||
rsync -avz -e ssh --progress /srv/containers/example/* nicole@192.168.3.30:/srv/containers/example
|
||||
```
|
Reference in New Issue
Block a user