wpmattuk Posted February 9, 2021 Share Posted February 9, 2021 Howdy! In a previous thread I started a while back, @brian! was good enough to touch on creating a dev environment from a live instance, but I thought I'd start a new thread so that this can stay very much on-topic, away from the previous email discusion. My live and dev environments are in very different states; I really haven't been very good at keeping dev up with live, so any testing I have done has been almost pointless - and I want to correct that. So, my question is - what's the best/correct/easiest/most thorough way to create a dev instance? Then, how do you use your dev? Do you make every change in dev, test it to-death, and only then replicate that change in live? And how do you replicate that change, do you simply re-type whatever you did in dev into live, or do you do something more automated/clever? So many questions in my head, but it's one of those 'I don't know what I don't know' scenarios, so simply don't know where to start. Thanks in advance everyone. Matt 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 10, 2021 Share Posted February 10, 2021 Copying the live's files to the dev's location and change the configuration.php file to use a dev database -- never dev with a production database. Then run the installer to get the database created and setup. Once done, setup any modules in their test modes. I don't think copying a production database to dev is wise and so setting everything from scratch is needed. Mirroring settings as best you can, but I suppose you could do a selective table copy and leave client specific tables in place. Once item is dev'd, tested, tested some more, and then deploy to production. I use git for version control and a self hosted git repo that can be accessed by dev and production. If you are not using version control, save yourself the hassle and use it. Git has saved me several times and the comparing alone is worth it. Since I use git, once the module is ready for production I will pull the module via git on the production install. Branching and selecting the new branch may be done depending on reasons. 1 Quote Link to comment Share on other sites More sharing options...
wpmattuk Posted February 17, 2021 Author Share Posted February 17, 2021 Thanks for this @steven99; I've successfully got a fully-working test instance now. I've never used git, or any version controlling before, but I'm aware I probably should. I just "don't know what I don't know" nor where to start. Can you offer any pointers on how to get started - specifically for customising WHMCS and using git/etc to push these changes live? Thanks Matt 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 18, 2021 Share Posted February 18, 2021 Take a clean install of WHMCS and place it on a dev.example.com where example.com is your real domain and ensure you block public access. Or if you have a dev environment setup for PHP locally, set it up there. Deploying a module to whmcs can be done in two methods and depends on how WHMCS is setup - locally or remotely. For locally, you could just setup the module folder within the install and setup git within that folder. For remotely setup dev of WHMCS, the method I use is pushing to remote git repo and then cloning the repo in the addons / servers folders. Then when needed, I'll do a git pull using SSH within that module's folder. Plesk has a git support built-in with git repo hosting and will use that for now. But a git repo hosting can be setup on a VPS and isn't to hard if you know Linux and apache or nginx. Or you can simply use FTP and upload the files but it makes it harder to track the files on the server then -- are you sure you uploaded that one file? Git ensures it and if a file is different, it wont pull changes down and will complain. I use phpStorm and it handles most of the git actions. If your IDE has git support, great. If not, total bummer and you'll need to do commits, pushes, etc from command line. I would suggest using an IDE that has built-in git support as it just makes it so much easier. 0 Quote Link to comment Share on other sites More sharing options...
wpmattuk Posted February 24, 2021 Author Share Posted February 24, 2021 Thanks for the reply @steven99; I'll try to make sense of this! It's all new to me so doesn't make immediate sense to me (so this is a good starter for me). 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.