How to create/manage a development, staging and production site for Opencart?

Currently opencart is at /var/www/opencart and if I want to change something I use filezilla to paste over the existing content.

I want to create a workflow of development then staging to test and then production when everything looks fine. I would need to keep track of the changes/versions in case of needing to rollback.

Should I create to test the staging phase on the same server?

For development, I was thinking on creating a localhost config file for nginx.

Server is LEMP with MariaDB, PHP7.2 and Opencart


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @NGINXuser,

What I believe the best approach should be a git/gitlab repo. From there you can create a master repository which would be for your production website.

If you wish to have a test or staging environment you can always just fork/create a branch repository and make the changes there. As soon as you are sure the changes are actually working, you can merge the branches and pull them on your master environment.

Those are the basics which should be enough for your goal.

Regards, KDSys