Forum

Thread tagged as: Configuration, Hosting

Staging vs Production database

Hi! I just took a client's website live, moving it from a staging subdomain to the production domain on the same webserver.

Both staging and production deployments of Perch are posting to the same database hosted on the same mysql server. Is this problematic? I've warned the users that if they log into the staging server, any changes to the db they post there will go live. Should I duplicate the db, give it a different name and link the staging server to the duplicate?

This is the first time I've tried a client-accessible staging + production server approach and I'd appreciate any input from folks more experienced in this type of set up.

Joel Davies

Joel Davies 0 points

  • 4 years ago

Hi Joel

Definitely use two databases. You'll lose track really quickly so it's easier to manage the two.

A tool like Navicat will allow you to sync the databases really easily from your desktop, rather than faffing around in Phpmyadmin.

I then use Beanstalk to deploy the latest changes to a Git production and staging repository (I use Tower to do this - I'm a designer so the CLI terrifies me!). I then manually sync things like resources and config files to each environment using Transmit.

Hope this helps,

Jon

Thanks! I'll check out Navicat, as the prospect of juggling two dbs via phpMyAdmin was pretty much what gave me pause.

I'm only GIT-curious at this stage!