So if I take a
mysqldump of my production database called
production_database, but I've made changes to by test environment database already, called
work_database, adding function/stored_procedures/tables/collumns. What will happend to that when I run my
mysql import? Will I lose all of my changes I made on my
work_database or will it only transfer the new data and not remove anything?
The reason why I need the
production_database copy, is because it's updated 27/7 with the latest data, and I'm making a test environment, that each night is updated with the latest results.
These are my
mysqldump & mysql commands:
bin/mysqldump.exe -uUsername -p-hHost.com --lock-tables=false --single-transaction --routines --triggers production_database >backups/backups01/testdump.sql bin/mysql.exe -uUsername -p -hHost.com work_database <backups/backups01/testdump.sql
EDIT - Testet it
So I tried to add a
extra column to one of my tables and it was removed when I did my
mysql.exe import. But when just create somthing totally new like a
table/function/stored_procedure (NO edits), then it's still there since the import doesn't overwrites that. How can I avoid mysql to overwrite adding new collumn/edits to a function/stored_procedure, and just make it use my default column settings and/or just leave that new data/functions/stored_procedures alone if thats even possible?
It's just not smart to have this automatic update of data, if the programmers database changes gets overwritten.
Maybe I could implement something on my
mysql.exe command that tells it only to do the full import if the structure/functions/stored_procedures/columns is the same (new data is okay)?