cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a local environment/test branch and make changes to the setting carry over to production

How to make a local environment/test branch and make changes to the setting carry over to production

Hello, I'm very new to Magento 2. I've tried googling this, but could not find the right solution.

 

I currently have a website up and running, however, I don't want to be constantly editing the website and risk breaking it while customers are already interacting with it.

 

I run Magento 2.4.3 on an Ubuntu 20.04 VM instance.

 

The problem is, as I understand, changes in the admin page of Magento are saved in the database. So, for example, if I've made an exact duplicate of my production website, edited it in my local environment and ready to make it the new production website, what would the process be? If the customers' data is stored in the database, wouldn't uploading the new configurations to the database from the local environment delete my customers' data?

 

Is there a better way of making a local/testing environment? All I want is the ability to not mess with my site that is currently live while trying to experiment with it.

4 REPLIES 4

Re: How to make a local environment/test branch and make changes to the setting carry over to produc

@gaccincogm60cb 

First of all, take backup of your live store and download it in your local

 

Now, set up that in your local and apply your required changes

 

When you find the desired success in your local store, update it to your live and apply the same changes in the admin that you've applied earlier on the local's admin.

 

For more detail, please refer this:

Problem solved? Click Kudos and "Accept as Solution"

Re: How to make a local environment/test branch and make changes to the setting carry over to produc

Okay, let's say I create a staging server that is the exact duplicate, set its URLs to the staging one, how do I deploy it to the production?

 

Files are simple, I can just override the ones in the production server with the staging ones, but how about the database? If I understand correctly, things like product data, configuration data, settings (in admin page) are all stored in the database. If I try to import the staging database, wouldn't that override customer data such as transaction history and anything else that gets saved in the database?

 

 

Re: How to make a local environment/test branch and make changes to the setting carry over to produc

Hi @gaccincogm60cb 

I suggest you to use version control like Git to track files modifications.

 

For the database changes like product import, system configuration values changes, you should not import staging database to the production website.

 

For products import you can create a csv file and test import it in staging site. If it works fine then same file you can import to the production website.

 

For the system configuration changes you should make the changes directly on production website once you have tested those changes in the staging website.

 

Thanks

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: How to make a local environment/test branch and make changes to the setting carry over to produc

Ah, so just make changes in the testing server then manually re-do the configurations that were made?

 

Feels like that would be time consuming for things like page customization or configuring modules.