How to safely deploy a core database in a live production database in magento

Being very new to version control and source code, I wonder how some of you shared the secure update updates to the developer database in production using Magento and what tools will help you with that.

I have a repository setup for my dev changes and a local machine on which the dev version of magento is installed, but I donโ€™t know a safe (and correct) way to merge the changes in the database. What if I add some products, add an extension, change some administrator settings in my dev environment, but want to combine my changes with a live store that accepts orders, adds customers, etc.? I would have thought that some type of merge would be appropriate, almost like the original control for the database, but is this possible?

I'm not sure if this helps or matters, but I use NetBeans and I often use Navicat to view db tables, etc.

+4
source share
2 answers

Schema Database Version
Not very important - since each Magento module can have its own set of settings / update scripts . If interested, there are tools for managing the database schema, such as dbDeploy .

Database Content Update
Representing the environment as a set of levels, at the top is an intermediate environment, and below (at the same level) are the development environment. All code changes can be performed in any environment, since all environments are just working copies of the same version source code. Each database is captured from the following โ€œtierโ€ environment. So, for example, the dev environment pulled the database out of the staging environment, and when the production environment exists, the staging environment will start from there. Therefore, any changes in the database (for example, updating a product, changing a parameter in the configuration panel, etc.) must be performed at the highest level, and then all levels below this will receive changes the next time they update their database. Now, obviously, during development, you can change as many things as you want to make it work well in your development environment before making these changes above.

How a pulling business works
Pulling (and pushing) the database is pretty simple, mysqldump is executed from the database, then it is searched / replaced (using sed or something similar) with the URL changes, and then imported into the new database.

Having said that ...
Kudos to you that your source code was a version, this at least means that if you need to follow my scenario, you can fully test the module in the development environment before making changes to the production. I wish I could offer more of a specific โ€œsolutionโ€ - since implementing changes in several environments is certainly not ideal, although I will be interested in what others bring.

+4
source

Extensions have installation / upgrade scripts, so updating a product should not be a problem.

But if you want to transfer product / attribute changes from the stage to production, you need to use the export / import tool. For example, it could be a native magenta export to csv.

Or I can suggest using an automatic migration tool that will compare the intermediate and production database and transfer all products or attributes that are missing on the server http://xpscommerce.com/blog/quick-push-magento-database-to-production/

Product transfer also includes image transfer.

To run the migration tool, it had to configure an XMLRPC account to access the server data.

0
source

Source: https://habr.com/ru/post/1392969/


All Articles