Support Center

Recent questions

About Koken

This Help Center provides support for Koken, a free content management system designed for photographers, artists and designers.

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Migrate db to koken Docker

Chris

Aug 21, 2014 06:14AM EDT

Hi,

I'm testing koken on Digital Ocean using Koken Docker Image. And this seems really fast !

But I've a question:

I can migrate all data using sFTP but I would like to know How to migrate the database.

Regards,

Chris

Up 0 rated Down

Team NetObjects Koken Agent

Aug 25, 2014 12:30PM EDT

Chris – The MySQL data is stored in /data/koken/mysql on the DigitalOcean host. I’m not sure what the best way to import it would be, or if it is even possible at this time. We’re looking at better ways of doing this, but for now it may take some trial and error.

Up 0 rated Down

Dave

Aug 26, 2014 01:00AM EDT
I had the exact same question, and I've been playing with this over the past few days and finally got a Docker-to-Docker migration working successfully. If you are migrating from a non-Docker MySQL instance into a Docker instance, you can skip the first part of this and just start with a mysqldump file directly.

First, I installed nsenter on the source Docker host, which allows me to enter the Docker container and connect to the mysql server directly. I followed the instructions here: https://github.com/jpetazzo/nsenter.

docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter

Then I entered the container and ran mysqldump, using the koken user/pass from www/storage/configuration/database.php.

docker ps # find the container name
docker-enter <container_name> mysqldump -ukoken -p[password] koken --single-transaction --routines --triggers > /data/backup.sql

This backup file can then be migrated to another Docker container (or MySQL database). You'll have to install nsenter again on the target host as well.

The /data/koken/mysql folder is mapped to /var/lib/mysql, so just copy it to /data/koken/mysql/backup.sql on the target host.

docker-enter <container_name> mysql -u koken -p[password] koken < /var/lib/mysql/backup.sql

One thing to keep in mind: the Koken Dockerfile sets up a random password for the MySQL user when it runs. So if you take a backup and move it to another Koken Docker container, you will need to import it using the password for the target container, not the source container. And when copying the /www/ folder, don't overwrite the database.php file, since that's where the new password is stored.

Hope that helps.

This question has received the maximum number of answers.

support@koken.me
http://assets0.desk.com/
false
koken
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete