Forums » SEPHP Help and Tips

How to Create a Development Environment

    • 30 posts
    December 31, 2017 3:27 PM EST

    I have a situation where I have purchased 3 SocialEngineAddon products and can't use any of them because they take too long to figure out and configure. I don't want my site to be down while I try to make the addons work...they usually destroy the look and feel of my site (I use Insignia Black theme by Webligo Developments). On two out of the three purchases I've had to restore the site from back-ups to restore full functionality and appearance.

    So, here's my ask...

    How can I create a development environment to test third-party plugins? I'd prefer not having to set up another server or lease one on TMD. I thought of creating a sub-domain and installing SE PHP there. Has anyone does this? Or, is there a better way?

    Thanks folks!

    Andy

    • Moderator
    • 4263 posts
    January 1, 2018 5:23 AM EST

    First thing, require any experts whose products you want to use to submit those products as certified and only buy certified. Why? Because we test those to install without errors.

    Second, yes definitely a development environment. You can do it on your server (not recommended), on another server which is set up to use the same domain with a subdomain such as development.yoursite.com (domain is either development or dev per the license requirements). Your main site would be at yoursite.com and the dev on the development.yoursite.com . I used to have this sort of setup at cazaratech.com hosting. My dev site was closed to the public (required by the license) via a password protected directory. That site was a clone of my live site. I still host with them but decided it was easier to work on a local environment as I do this:

    1. Use netbeans - it's easier for changing code if you need to change code.

    2. Use Mamp Pro - it works on windows and mac environment and I use it on both. I love it. It's easier to set up than Xampp.

    Once you install Mamp Pro, you then install either a fresh install of SE or download your backups (site files and database) and load it into a folder in your htdocs folder. Once you've unzipped the files and imported your db into the phpmyadmin (and yes, definitely set a password on your phpmyadmin), you change the database details in your settings file and change the lines mentioned in this tutorial. Clear cache and you should be good to go. 


    This post was edited by Donna at January 1, 2018 5:25 AM EST
    • 30 posts
    January 2, 2018 3:03 PM EST

    Thanks Donna for your response. I appreciate it.

    Unfortunately I am not a developer. I'll have to point that out in future posts. Your recommendations are beyond my skill level. I'm a struggling novice with some expertise in very limited areas on the front end of things; not system administration.

    I merely want to test a theme or plugin to see what it's going to do to my website. Even certified plugins/themes are not suitable for every customer. For Example, I bought and activated a SocialEngineAddons theme. Activation of the theme changed the appearance of my website so dramatically that it was unusable. There was no warning that the activation would blow away my landing page; that I would have to recreate it. This information was provided after the activation, not before hand. Also, the activation of their theme made changes to my header that were irreversible even after deactivating the theme and choosing a SE provided theme. I had to restore the SQL DB from backup. There were other issues too, but my point is that if a had another copy of SocialEngine in a dev area, I could have tested this theme there instead of my live site. My site has a word-wide audience so people are calling my site on a 24/7 basis. This was an embarrassing moment.

    So, with that in mind, I suppose creating a sub-domain on my current site would be OK for this purpose?

    ~Andy

     

     

  • gs
    • 861 posts
    January 2, 2018 9:08 PM EST

    ==> 'Unfortunately I am not a developer. I'll have to point that out in future posts. Your recommendations are beyond my skill level. I'm a struggling novice with some expertise in very limited areas on the front end of things; not system administration.'

     

    I'm in the same boat, so I rely on my host (Fastcomet) for things like this.  Whenever I need to clone my site to Dev or remove my Dev, they do it with no problem.  I mention all of that to ask if you've condidered asking your host to do this for you, so you don't have to bother?  I'm sure it's fairly ez to do these things, and gets easier each time, but I figure I'm paying for a managed host so why not use them.

     

    Re SEAO and any other 3PD: When it comes to anything theme related, I've learned the hard way too.  Although most times they may be switched back 'n forth, sometimes certain things are lost (LP widgets for example).  I have learned to take periodic snapshots of LP/Header/Footer which include screenshots of the page, screenshots of each widget's settings, and also copy/paste the contents of HTML blocks for future reference, as well as the various .css files for the theme.  It may not be the best tool, but I use Word so everything is all in one doc as of 'now' for future reference, with a diff file for each point in time.  This has also saved me when I've carelessly changed or deleted something that worked and can't recall what the settings/layout was prior to my boo-boo.

     

    Just my 2 cents.

     

    @Donna - for clarification on licensing, must a subdomain be used for Dev or is a folder acceptable?  Thx.


    This post was edited by gs at January 3, 2018 12:40 PM EST
    • Moderator
    • 4263 posts
    January 3, 2018 4:46 AM EST

    A subdomain or subfolder but really you should get it on another server but using the same domain for license requirement. 

    Don't be afraid to try local. It's easier than you think. When I started my site, I didn't even know how to FTP back then. I have since learned a lot of stuff. Mamp is the best one to use as it's very easy to set up. Mamp Pro is even better as it's got a lot of things automated. You'll be surprised at how easy it is.

    • 30 posts
    January 3, 2018 9:01 AM EST

    Thanks GS for your 2 cents. They were more valuable to me than that for sure.

    That's a good idea to ask my host service to do this for me. I think I'll do that after I find a solution for my content storage and bandwidth use. It looks like I'm going to have to upgrade my plan as I'm starting to max out on disk space or pair down what I am allowing my users to upload (currently 3,060 photos and 374 videos). Regardless, I think your suggestion is spot-on.

    We're on the same sheet of music regarding screenshots and making copies of the CSS. I was considering doing that as part of my next backup routine for any new plugin or theme.

    ~Andy

     

     

  • gs
    • 861 posts
    January 3, 2018 9:52 AM EST

    @Donna

    Question#01: (I apologize for my lack of understanding) Are local server configurations (SE or any 'website') accessible only on your local workstation?  on your internal LAN?  External to your LAN (i.e. from the Internet)?

     

    I'm asking because I see a benefit to protecting the environment from others, but at the same time, if one needs to allow others to work on the site (i.e. 3PDs), how can they do this (directly - not via Team Viewer/etc. apps)?

     

     

  • gs
    • 861 posts
    January 3, 2018 9:58 AM EST

    @Andy

     

    RE: Storage

    Q#01: Are you using a separate storage server?

     

    Q#02: Is linking to Videos an option for you (either all or some) or do you require everything to be stored/accessed internally?  I ask because I've been using SEAO's Advanced Video/Channels Plugin (SES also has an excellent one), and I paid to customize it to allow settings by ML for video source (Youtube, Vimeo, Dailymotion, Other, Upload).  This paid customization is now included in the Plugin, so it's available to every purchaser.

     

    Obviously, both of the above should help offload storage and processing requirements from your primary server, but based on your requirements may not be an option for you.

     

    • Moderator
    • 4263 posts
    January 3, 2018 11:23 AM EST
    gs said:

    @Donna

    Question#01: (I apologize for my lack of understanding) Are local server configurations (SE or any 'website') accessible only on your local workstation?  on your internal LAN?  External to your LAN (i.e. from the Internet)?

     Yes, these are local installs. You can open to others but I don't recommend it unless you have a separate computer for that. I like to test on my own local environment as it's easier than on a live server.

    I'm asking because I see a benefit to protecting the environment from others, but at the same time, if one needs to allow others to work on the site (i.e. 3PDs), how can they do this (directly - not via Team Viewer/etc. apps)?

    For allowing third parties, most have their own dev servers for custom work. Another option is for you to make a dev site as mentioned above on a live server.

    • 30 posts
    January 3, 2018 2:32 PM EST

    For GS...

    "I'm in the same boat, so I rely on my host (Fastcomet) for things like this.  Whenever I need to clone my site to Dev or remove my Dev, they do it with no problem."

    When you ask your host to clone your site for dev purposes, are you leasing another server to clone your site to? If you do, are you still within the one domain rule for SE? If so, I'm baffled...how can one domain name point to two different servers.

    AH

  • gs
    • 861 posts
    January 3, 2018 3:50 PM EST

    ==> '... how can one domain name point to two different servers.'

    My understanding is that it can't, but domain/subdomain can.  So yoursite.com can point to server1 and subdomain.yoursite.com to server2 (server = server/VPS/cluster/etc.)

     

    In my case, I use the same server/VPS but use a separate folder.  Donna is of course correct that it's best to keep things on separate servers (hence the local idea), but local doesn't seem to easily allow 3PD access, and I prefer not to spend a lot of $ on a separate configuration right now.  So when I request to create a clone, I typically provide necessary details (folder name, database name, etc.) and FastComet does the rest.  

     

    As far as access goes, access to the Dev folder is simply via URL, such as yoursite.com/dev instead of yoursite.com for your live site.

     

    This is just one way to do it of course.

     

  • gs
    • 861 posts
    January 3, 2018 3:50 PM EST

    ==> '... how can one domain name point to two different servers.'

    My understanding is that it can't, but domain/subdomain can.  So yoursite.com can point to server1 and subdomain.yoursite.com to server2 (server = server/VPS/cluster/etc.)

     

    In my case, I use the same server/VPS but use a separate folder.  Donna is of course correct that it's best to keep things on separate servers (hence the local idea), but local doesn't seem to easily allow 3PD access, and I prefer not to spend a lot of $ on a separate configuration right now.  So when I request to create a clone, I typically provide necessary details (folder name, database name, etc.) and FastComet does the rest.  

     

    As far as access goes, access to the Dev folder is simply via URL, such as yoursite.com/dev instead of yoursite.com for your live site.

     

    This is just one way to do it of course.

     

    • 18 posts
    January 5, 2018 12:00 AM EST

    This reply is to share (vent) my recent experiences similar to Andy Holmes and not on the topic.

    I have the same issues with SocialEngineAddons plugins (bought at least 7 plugins and each have at least one 'bug' that the users will see).  E.g. Advanced member location don't fill out correct City field, Advanced activity feed won't hide add friend, Advanced Events have an issue with displaying create event, changed up some theme display. Likewise, with SocialEngineSolutions, I bought two plugins and one of the tab in SES core in the admin portal gave error message, but at least the user side worked and looked fine.  Even with a SocialEngine certified 3rd party developer theme, I still had to contact the company and get a simple css fix for their theme showing up in the Search drop down box.  Both SEAO and SES ask for your admin and FTP credentials when submitting tickets.  SES also asks for cpanel logins.  Some people, like myself, will hesitate to give that out.  SEAO and SES has no open knowledge base on the status of their plugins (that I have found).

    Going into this (using SocialEngine and other plugins) about two months ago, I was hoping to plug and play with SocialEngine and 3rd parties plugins, but now realized it has been a development time sink.  Even when the software works perfectly, establishing the settings and page layouts took and will take more time for me.

    For those going into this, I think it's good to know that it will cost you more money than just buying the SE software and 3rd parties plugins.  Depending on your needs, I expect it could cost you much more for IT support (and more time).  If you're familiar with coding or figuring/tinkering with the codes, then that skill will be very useful in this project.

    • 18 posts
    January 5, 2018 12:34 AM EST

    This reply is in regard to Create a Development Environment for SocialEngine.  I tested it out myself.

    1. In your cPanel, create a subdomain (e.g. development.example.com)
    2. Go to your File Manager, copy your SocialEngine files from your current directory to the root directory created for your subdomain.
    3. Create a new database (e.g. newDevelopDatabase)
    4. Export your current database into an sql file
    5. Import the sql file to the new database you just created.
    6. Go to the database.php (search for it) in the subdomain folder, change the database name to the new development database name. Ensure correct username and password.
    7. Go to .htaccess file and add the following code at the top of the file to ensure only you can access the site.  Replace the xxx with your IP address.  See the code at this link for the correct brackets, not allow to show here: https://stackoverflow.com/questions/4400154/deny-all-allow-only-one-ip-through-htaccess

              RequireAll
                    Require ip xxx.xxx.xxx.xxx
              /RequireAll


    You will need to know how to copy files and export your MySQL database. These are actually fairly simple and can be done in cPanel ("click and drag").


    This post was edited by Kieuph at July 13, 2018 3:03 AM EDT
    • 18 posts
    January 5, 2018 12:53 AM EST

    How to backup files and MySQL database (this is what your entire SE site is made out of, for those who may not know)

    Before installing any 3rd party plugins (because I expect it to mess up my styling in some way), I do a complete backup of my files and database.  When a plugin changed my site to something unusable, I just delete the entire site and restore my backups (which, to my delight, is just the files and the database.)

    Backup Files

    1. Go to Cpanel
    2. Click on File Manager
    3. Click on public_html folder
    4. Go to Settings (upper right corner) and make sure Show Hidden Files (dotfiles) is checked.  If not, check it.
    5. Click Select All (all files and folders in your public_html should be selected.)
    6. Click Compress
    7. Select Zip archive
    8. Click Compress File(s)
    9. ...wait a while
    10. Name your zip file (which will show up in the public_html folder) and download/move it to a backup location of your choice.

    Backup Database

    1. Go to Cpanel
    2. Click on phpMyAdmin
    3. Click on the database associated with your SE site.
    4. Click Export
    5. make sure "Quick - display only the minimal options" is selected.
    6. Click Go
    7. The sql file will download to your Download folder on your computer.
    8. Save the file to a backup location of your choice.