I’ve installed invoice ninja via docker, and after some teething issues, everything is working.
Does anyone know, what the procedure is for making backups? ideally, I’d want to backup all client, quotes, payments, and invoice, etc aswell as the customised invoice design/settings.
What approach did you take to storing your container’s data (internal docker volumes, or external binding)? You’ll have to back that up and then the mysql database using something like mysqldump - include the docker-compose.yml and associated files and you have pretty much everything.
So, I’m using the internal docker volumes, so I can use standard tools to take a backup of these.
In terms of the mysqldump, how would I run this as the db is part of the docker-compose environment. I’m guessing get a /bin/bash shell within the container, then take a backup using mysqldump then?
Hello everyone,
i am a new user of Invoice Ninja but wanted to help out here. I was able to backup and restore (migrate) my environment between 2 different hosts.
This is documented in docker’s website but it would be great if Developers would confirm my steps.
To backup App & DB containers i used these 2 commands, it backup the database and all data:
docker run --rm --volumes-from dockerfiles_db_1 -v $(pwd):/tmp/backup mysql:5 tar cvf /tmp/zkd/backup-db.tar /var/lib/mysql
docker run --rm --volumes-from dockerfiles_app_1 -v $(pwd):/tmp/backup alpine tar cvf /tmp/temp/backup-app.tar /var/www/app/storage
Than on new host i followed the installation procedure on github: https://github.com/invoiceninja/dockerfiles, once new blank containers were up i run these commands to restore the data. Of course i copied backup files to the temp folder
docker run --rm --volumes-from dockerfiles_db_1 -v $(pwd):/tmp mysql:5 bash -c "cd /var/lib/mysql && tar xvf /tmp/backup-db.tar --strip 1"
docker run --rm --volumes-from dockerfiles_app_1 -v $(pwd):/tmp alpine sh -c "cd /var/www/app/storage && tar xvf /tmp/backup-app.tar --strip 1"