Post by AlanARG » Thu Oct 15, 2020 2:31 pm

Hey guys, how u doing?

I'm working at a project right now doing some testing and data entry and we have a "local" environment for testing purposes in order to test modifications before actually uploading them to the "live" version of the website. We use git for this and I use VS Code to modify stuff and then push them.

It's logical to work this way so I wanna do the same with OpenCart but I already have my website working with lots of modifications so, is it possible to "copy" my website and install it on my computer (local)? I've found three options so far:
1. Install OpenCart using XAMPP.
2. Similar to what we do at work with git and stuff.
3. Someone in that post suggested TortoiseSVN.

Any other ideas or suggestions?

Thanks! :)

Active Member

Posts

Joined
Mon Feb 22, 2016 6:15 pm

Post by OSWorX » Thu Oct 15, 2020 2:48 pm

Basicall operating a "dev server" locale is a very good idea!
Would be good if more people would do that ..

Back to you:

1. install XAMPP (32bit only up to php 7.2.x, 64bit has also php 7.4.x)
2. use TortoiseSVN
3. set up TortoiseSVN locally and work with that (if you need a version control)
4. install optional Winmerge (to compare files and folders easily)

Further:

A. make a complete copy (folders and files and database) of the live shop
B. copy all folders and files as the are into the local folder after htdocs (xampp) into a new subfolder
C. adjust the 2 config.php (catalog and admin)
D. (optional): adjust the .htaccess

Now you have a locale copy of your live shop you can test whatever you want/need.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by AlanARG » Thu Oct 15, 2020 3:18 pm

OSWorX wrote:
Thu Oct 15, 2020 2:48 pm
Basicall operating a "dev server" locale is a very good idea!
Would be good if more people would do that ..

Back to you:

1. install XAMPP (32bit only up to php 7.2.x, 64bit has also php 7.4.x)
2. use TortoiseSVN
3. set up TortoiseSVN locally and work with that (if you need a version control)
4. install optional Winmerge (to compare files and folders easily)

Further:

A. make a complete copy (folders and files and database) of the live shop
B. copy all folders and files as the are into the local folder after htdocs (xampp) into a new subfolder
C. adjust the 2 config.php (catalog and admin)
D. (optional): adjust the .htaccess

Now you have a locale copy of your live shop you can test whatever you want/need.
Thank you so much for your answer, help and time.

Seems quite easy to do but I don't wanna make any mistakes so:
1. XAMPP opened up a control panel with different options like MySQL, Apache, FileZilla, Mercury, Tomcat and another bunch of choices, anything I should consider tweaking there?
2. Setting up TortoiseSVN means after installation I should do anything in particular?
3. Winmerge would be similar to VS Code? Like a file explorer?
/edit:
4. I don't have config.php inside catalog but I do in admin, what should I adjust? Sorry for such newbie questions haha
5. Same for .htaccess what do I need to adjust? :P

Sorry for the newbie questions but sometimes I'm not even sure what I'm doing hahaha

Thanks a lot!

Active Member

Posts

Joined
Mon Feb 22, 2016 6:15 pm

Post by OSWorX » Thu Oct 15, 2020 3:59 pm

No problem, it is always good to see when someone goes the "correct" way ..

Winmerge, see https://winmerge.org/
A tool to compare files and check the differences. Files can be edit directly in it.

XAMPP > Controlpanel: basically you need only MySQL and Apache. all others not really (but you can if you want).
What I do, is to edit the php.ini and "tweak" that a bit.
So, for example I add there my SMTP settings to be able to send emails right out of the dev shop the "normal" way.
Needed then also to enable and add the SMTP-Settings in the store configuration.

TortoiseSVN: I use that for my locale development.
Advantages are:
1. no external dependies
2. useable also when I have no internet
3. all files are stored locale

Simply install, setup (define your settings) and go.
But only needed if you want/need a "version control" (fine to have ..)

config.php
Every OpenCart Shop has 2 config.php: one in root folder, one in ../admin
Otherwise the store would not operate ..

.htaccess
Is optional if you want to test locale the SEO-URLs and/or other
If no SEO, and/or no additional requirement, no need to for a .htaccess

One (last) tipp: try to configure XAMPP the same way your production server is.
Same php-Version is very important, MySQL (Maria-DB) also.
Not so other like FPM or not.

But if you have some special settings on your production server, you should try to have them on your dev-server also.
If not replicable 1:1, try to have similiar options.
That way you avoid big troubles later!

And one more tipp: try to have a clean structure!
Do not put all files into one (root) folder.
For example:
{rootfolder} htdocs

Code: Select all

|- oc
  |- 3
    |- 3
      |- 0
        |- 3
        |- 6
      |- 1
and so on.
Doing so, calling the different OpenCart versions are very easy like:
https://localhost/oc/3/3/0/3 or https://localhost/oc/3/3/0/6

SSL-Certificate for enabling https can be done - and should.
With XAMPP it is not required to install an external or paid.
The default will not work (!!), because to weak.
Simply create one locale with stronger algo - search the net for instructions (is done within 2 minutes).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: paola_84 and 58 guests