0

My production database currently contains 4k MyModels (loaded from the dev database last year). I started working on this project again. I now have 270k MyModels (including the original 4k MyModels). I want to export this new datadump to my production database. What will happen to the 4k MyModels already there (doing a simple dumpdata/loaddata)? How will the records be overwritten?

Mike Johnson Jr
  • 776
  • 1
  • 13
  • 32

1 Answers1

1

After you dump your data into a file, you go and cd into folder where you keep your dump file and do

  • mysql -u root -p your_database_name < DumpDevDatabase.sql

NOTE:

Bare in mind that you will create new database in production every time you want to dump your data into it and that is a bad thing.

You should not do this, this should work the other way around, Production database need to be isolated from this things, you should dump data from your production to your development database so you can work with the data.

In that case when you dump data from production to development, again you need to create new database for loading data into it.

You can use tools like mysql workbench or pgadmin if you use postgreql, this will help you to easier work with your database.

I'm still not sure why you want to do it, but I strongly advice you not do overwrite your production database.

copser
  • 2,523
  • 5
  • 38
  • 73