Backup db in container

Sorry! I’m new to this, as you can tell. I revised my file so it looks like this now (but with my real password):

#!/bin/bash

/bin/mkdir -p /var/www/backup/db
/usr/bin/mysqldump -u cms -p******** -h mysql -P 3306 cms | gzip > /var/www/backup/db/latest.sql.gz

After editing that file, I ran destroy/bootstrap again. Still no latest.sql.gz. Everything does work correctly in Xibo, I was just worried that my only way to backup was to take an entire Snapshot of the server on VMWare.

That looks right to me now.

I can’t think why it wouldn’t be working.

What I’m doing is building a new container with the right script built in - so it’ll just ignore those files. It’ll take an hour or so to build. Once that’s happened, a destroy/bootstrap should resolve things for you - assuming the usernames and passwords in launcher.env are correct.

Ok, thank you. I did verify the usernames and passwords in launcher.env are correct (at least I think they are, I can really only test the MySQL root password, not the CMS password).

How are you testing the root password? The container doesn’t expose the service to you by default. Or have you made other changes for that?

Ok - that’s the problem…I just tried mysql -u root -p and the password in launcher.env for MYSQL_ROOT_PASSWORD= is not the same. I must’ve changed it at some point when I tried to move from 1.8 to rc2.

Is it better for me to change the MySQL root password to match launcher.env, or change launcher.env to the MySQL root password and destroy/bootstrap again?

If you’re running that from a command prompt then you’re connecting to MySQL on your host machine, not MySQL running in the Docker container. They’re completely separate.

With Docker, everything (webserver, CMS, database, XMR) run inside containers and use nothing from your host machine at all.

If you wanted to test the passwords in the launcher.env file, then you’d need to get a shell inside your CMS container and try them there.

I’m reasonably confident though that they are correct. Please give me some time to let the new containers finish building, then update to those, and I’m sure the backup file will be generated correctly for you once a day.

Ok, thank you! I’ll wait before doing anything.

They just finished building.

If you do a destroy/bootstrap now, and then wait 10-15 minutes, the latest.sql.gz file should be recreated for you.

I did mine at 15:44 local time and latest.sql.gz updated at 15:50. If you open that file, you should see the output from mysqldump in there.

Oh, that did it! I ran the latest destroy/bootstrap, and didn’t have to wait 10-15 minutes, and the latest.sql.gz appeared in the /home/xibo/library/shared/backup/db folder. Thank you!!! I’ll look tomorrow and make sure it’s updated as well. Thanks again!!

root@lamp /# cd /home/xibo-docker-master/
root@lamp /home/xibo-docker-master# ./launcher destroy
Reading configuration                                                                                                                                                                                
Destroying CMS Docker Containers (your data is safe!)                                                                                                                                                
xibo-cms-web                                                                                                                                                                                         
xibo-cms-xmr                                                                                                                                                                                         
xibo-cms-db                                                                                                                                                                                          
xibo-cms-web                                                                                                                                                                                         
xibo-cms-xmr                                                                                                                                                                                         
xibo-cms-db                                                                                                                                                                                          
CMS containers removed. You will need to bootstrap again in order to run the CMS.                                                                                                                    
root@lamp /home/xibo-docker-master# ./launcher bootstrap
Reading configuration                                                                                                                                                                                
Bootstrapping CMS Docker Containers                                                                                                                                                                  
release_1.8.0-rc2: Pulling from xibosignage/xibo-cms                                                                                                                                                 
16da43b30d89: Already exists 
1840843dafed: Already exists 
91246eb75b7d: Already exists 
7faa681b41d7: Already exists 
97b84c64d426: Already exists 
b1cc58a832e2: Pull complete 
e20eb5add2aa: Pull complete 
07079ec02aea: Pull complete 
05f462a88b60: Pull complete 
4980dadef1de: Pull complete 
18dd780edbf7: Pull complete 
2852e9bb0862: Pull complete 
1f92127ae33b: Pull complete 
e602a80ce8d2: Pull complete 
d050d4d037d7: Pull complete 
9587e4b9ab7a: Pull complete 
70ba3a6c272c: Pull complete 
a46a4b59bfd7: Pull complete 
12c874ad430f: Pull complete 
afeb90dc8871: Pull complete 
09c63ce1a9e8: Pull complete 
1122b807c8a3: Pull complete 
b2d19d413f19: Pull complete 
78f08ab61f01: Pull complete 
b1ea08c44962: Pull complete 
bbeb5ddbb141: Pull complete 
a55e12565de5: Pull complete 
b6181766b81f: Pull complete 
0658b3262241: Pull complete 
033cb954a1c3: Pull complete 
e401d58fe86d: Pull complete 
Digest: sha256:0db23e48cc7a5529f294fe3e45b615fd538bf5f765f5df6a6863bb9f7cd5c375                                                                                                                      
Status: Downloaded newer image for xibosignage/xibo-cms:release_1.8.0-rc2                                                                                                                            
release_1.8.0-rc2: Pulling from xibosignage/xibo-xmr                                                                                                                                                 
Digest: sha256:8c1a85e53515bf90ea2ab488f4394ff41460504093d3c4c65a6e41aa94f34646                                                                                                                      
Status: Image is up to date for xibosignage/xibo-xmr:release_1.8.0-rc2                                                                                                                               
5.6: Pulling from library/mysql                                                                                                                                                                      
Digest: sha256:afbd1708374fb8e5fa68c11c23be53a43a797ede4c04d399dd04b8893b2e75e2                                                                                                                      
Status: Image is up to date for mysql:5.6                                                                                                                                                            
580facf9c127fb0c23c33b32c76da070bee09dac648cf83bebbc58e1931b6448                                                                                                                                     
fda18332371bbc2b9902b22a240700277724c0a85c4fda54b50116096f3eba70                                                                                                                                     
4f25ea8322b03b2b1122d8a571e91c567cd9c23519359c782d8484e140a06d1e                                                                                                                                     
CMS is starting. It may take a few moments to be fully running

Great. Glad that sorted it :slight_smile:

1 Like