factorial-io / phabalicious

Supports your deployments and every-day devops-tasks
http://docs.phab.io
MIT License
18 stars 3 forks source link

'copy-from db' should handle the DB having been previously removed #178

Closed joachim-n closed 2 years ago

joachim-n commented 3 years ago

Because mysql was failing to start, I removed the volume with docker volume rm occhio-cms-be_db-data.

When I then did phab copy-from to get a clean copy of the DB, it crashed with this:

 // Do you really want to drop all tables in the database occhio_drupal8_db?:
 // yes.
ERROR 1049 (42000): Unknown database 'occhio_drupal8_db'

It would be useful if the copy-from command handled this by skipping the DROP TABLES and creating the empty DB.

stmh commented 3 years ago

The problem is not the drop tables, but the deletion of the volume, as this is basically the same as doing rm -rf /var/lib/mysql/* Usually you drop the db-volume only when there's a problem with your db and then just run phab -cmbb install:from xxx (which will recreate the database if it does not exist)

stmh commented 3 years ago

in 3.6 this will be complicated to add, but maybe in 3.7 as we are currently refactoring the complete database handling ... Thanks for the suggestion.