Migrate Rancher database from container to external

I wanted to switch from an in-container database setup to an external database setup. And I didn’t know what happens when you just lose all database contents, and I thought with Docker and some tweaking that should also not be necessary. So I just migrated the databases. Here’s what I did for those interested:

  • stop rancher
  • use a container (sameersbn/mysql) to mount the rancher database content and do a mysqldump
  • import the dump into the external database (AWS RDS instance)
  • start rancher up with different parameters (use external database, as described in the official docs)

And now the actual command lines:

(Don’t forget to stop the sammersbn container once you’re done). I have configured puppet to start rancher. The final configuration in puppet looks like this:

Restart, and it seems to be working just fine. To check go to http://RANCHER_URL/admin/ha (yes, we still use HTTP internally, it will change), and you should see this:

Bildschirmfoto von »2016-05-30 16-41-23«Nice.

#rancher