A blog for web developers about all things ecommerce.: Duplicating online and local data source for an easy workflow!
Duplicating online and local data source for an easy workflow!
Friday, February 26, 2010 12:00:00 AM
There are some things you can do when developing and testing locally that can ease your work-flow when it comes time to move your site to the online server, here's one of them that I was surprised to learn a lot of developers weren't using.
Mirroring your database / data source set up
Although Cartweaver CF supports Access database, it is always our recommendation that you move to a true database server such as MySQL or SQL Server. The advantages of speed, security, and stability are undeniable and well worth the additional set up and learning curve if you are not yet familiar with a these DBS'. Since both the ColdFusion and PHP versions of Cartweaver support MySQL I'll use it as the example here, although the principle apples equally to SQL Server.
Same user, both places.
It's a pretty simple procedure that will save you a lot of headaches. I was surprised to find that many developers will keep different sets of data source files, one for local work and one for the server. The reason for this is they have different log on and permissions locally. This can really lead to confusion and potentially an emergency if the local files are unintentionally uploaded to the server thus overwriting the server settings and breaking your site.
So here's a simple tip.
Using your Database admin - I'll use Navicat (my absolute favorite database admin tool) in this example - set up your local development database. Give this database the exact same name as you or your host used when setting up your database on the server.
Then in the user admin, create a new user and assign the exact same username and password you will be using on your host server. Finally when you set up your data source name (DSN) use the exact same DSN you have on the server... When I say exact, this includes CASE as well, due to the fact that many hosted MySQL servers are on Unix / Linux boxes and are therefore case sensitive. For ease of set up, go ahead and give the local user full permissions to the database for this application, the permissions don't have to mirror the server exactly.
Now, when setting up your local data source direct your DSN to this database using the username and password you just created. Now when moving files back and forth between your host server and your local development environment you wont have to worry about maintaining two data source set ups, since they are both identical it wont matter where the files are.
If you haven't been using this set up already, by all means start today, I hope you find this as big of a time saver as I did when I first discovered it.
Category tags: Cartweaver, ColdFusion, General Topics, True Life Stories
Posted by Lawrence Cramer
Add comment
|
View comments (2) |
Permalink
|
Trackbacks (0)
|
Digg This
Before posting comments or trackbacks, please read the posting policy.
Blog RSS feed