title: How to migrate Docker volume between hosts?
body: <p>Docker's <a href="https://docs.docker.com/engine/admin/volumes/volumes/" rel="noreferrer">documentation</a> states that volumes can be "migrated" - which I'm assuming means that I should be able to move a volume from one host to another host. (More than happy to be corrected on this point.) However, the same documentation page doesn't provide information on how to do this.</p>
  
  <p>Digging around on SO, I have found an <a href="https://stackoverflow.com/questions/28734086/how-to-move-docker-containers-between-different-hosts">older</a> question (circa 2015-ish) that states that this is not possible, but given that it's 2 years on, I thought I'd ask again.</p>
  
  <p>In case it helps, I'm developing a Flask app that uses [TinyDB] + local disk as its data storage - I have determined that I didn't need anything more fancy than that; this is a project done for learning at the moment, so I've decided to go extremely lightweight. The project is structured as such:</p>
  
  <pre><code>/project_directory
  |- /app
     |- __init__.py
     |- ...
  |- run.py  # assumes `data/databases/ and data/files/` are present
  |- Dockerfile
  |- data/
     |- databases/
        |- db1.json
        |- db2.json
     |- files/
        |- file1.pdf
        |- file2.pdf
  </code></pre>
  
  <p>I have the folder <code>data/*</code> inside my <code>.dockerignore</code> and <code>.gitignore</code>, so that they are not placed under version control and are ignored by Docker when building the images.</p>
  
  <p>While developing the app, I am also trying to work with database entries and PDFs that are as close to real-world as possible, so I seeded the app with a very small subset of real data, that are stored on a volume that is mounted directly into <code>data/</code> when the Docker container is instantiated. </p>
  
  <p>What I want to do is deploy the container on a remote host, but have the remote host seeded with the starter data (ideally, this would be the volume that I've been using locally, for maximal convenience); later on as more data are added on the remote host, I'd like to be able to pull that back down so that during development I'm working with up-to-date data that my end users have entered.</p>
  
  <p>Looking around, the "hacky" way I'm thinking of doing is simply using <code>rsync</code>, which might work out just fine. However, if there's a solution I'm missing, I'd greatly appreciate guidance!</p>