Add Scripts/Bash/Transfer Docker Containers.md

This commit is contained in:
Nicole Rappe
2024-04-10 05:22:51 -06:00
parent efefef1405
commit e68788c110

View 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
```