Page 1 of 1

Advice on dev environment set-up

Posted: Tue Aug 18, 2009 3:52 pm
by Si Burgess
Hi all,

Before I go and do something stupid thought I best ask those in the know...

I have a LIVE deployment working great and would like to do new development and testing on my PC. I would like the local install to point at the LIVE database so I can work with real data. My development work is new pages and controls that will only do data reads so I'm confortable working pointed at LIVE data as no data writes are involved. What I don't want to be doing is uploading and testing new code that doesn't work correctly and ends up bringing LIVE down. I'd be using VS2008 for my IDE and my localhost IIS for hosting.

I'm fearing that if I install locally and point the database connection to the LIVE database server the installation process will trash my LIVE db and the hours of plugging products into the system and the UI changes I've already made. I can't remember if there is the option to install and use the existing database without recreating it...

So, any ideas of how I can install locally and connect to my LIVE db without trashing existing the LIVE db? Or should I be looking at doing a db dump from LIVE to my local machine instead? I only have SQL Express 2005 on my PC.

Out of curiosity, where is the license key stored, on the file system or in the db?

Many thanks,
Si

Re: Advice on dev environment set-up

Posted: Tue Aug 18, 2009 5:21 pm
by AbleMods
Si,

Having a separate code base pointing to your live db only gives you half the protection you need. Anything in your test code base that runs amuck can now toast your live db. At that point, you've only changed WHERE your problem will occur and not IF it will occur.

I always use SQL backups from the live db to restore to my local dev install of SQL 2005 Express. Then anything I test, I can test fully and not affect my live storefront. That way my data in the dev install is within 24 hours of the live one - completely sufficient for testing purposes.

The easiest trick is to unencrypt your database connection string in the dev admin. Then edit the ~/App_Data/database.config file to point to your live db. But you're going to need a local SSL cert installed in your dev environment because your live store settings table is going to enforce the live SSL settings. See why this is such a bad idea?

The license is stored in the ~/App_Data/CommerceBuilder.Lic file and is coded to your live domain. You wont' be able to use it in your local install. But if your local dev install is already functional, then licensing won't be an concern for your situation.

Re: Advice on dev environment set-up

Posted: Tue Aug 18, 2009 7:18 pm
by afm
Si,

Don't do it. Follow Joe's advice and use a local copy of your data.

Re: Advice on dev environment set-up

Posted: Tue Aug 18, 2009 7:49 pm
by ZLA
Si, I agree with both of them. However, to save yourself time in supporting two sets of code and data, I recommend investing in ApexSQL's products (Data Diff and Diff) and Beyond Compare. Beyond Compare is about $50 for a single user while Data Diff and Diff seem to be about $300 each currently. I thought the ApexSQL products were less but I think they just release a brand new version in the last month and the prices are higher than when I purchase my bundle. You may want to look for older versions. These products make it much easier to synchronize changes.

Re: Advice on dev environment set-up

Posted: Tue Aug 18, 2009 11:59 pm
by Si Burgess
Thanks all for the advice, I'll go down the db backup and restore route. :) Any pointers as to which SSL cert would be sufficent for a localhost install in IIS?

Re: Advice on dev environment set-up

Posted: Wed Aug 19, 2009 4:35 am
by AbleMods
You don't need an SSL for a local dev install. Just open the ac_StoreSettings table after you restore the db and change the SSLEnabled flag from True to False.

There's plenty of documentation on Microsoft's site about setting up a local self-cert SSL. That way you don't have to buy an actual cert.

Re: Advice on dev environment set-up

Posted: Wed Aug 19, 2009 6:19 am
by jmestep
Ditto on the don't use the live database. Be sure to get your dev license issued for "localhost" if your ip address changes because of your ISP. That way you don't have to run your test site in demo mode where all the orders have DEMO for name and address.

Re: Advice on dev environment set-up

Posted: Wed Aug 19, 2009 8:16 am
by Si Burgess
Sounds good to me, thanks all, much appreciated. :)