1

I'm working for a company who have an ExpressionEngine 3.x website. They have 2 copies: a dev version (on a development server), and their live website.

Periodically I will pull down a full copy of the live website (file structure + database) on to the dev domain.

Staff at the company will be making different changes to both websites. For example the live website has a 'news' channel which is constantly updated - whilst it will remain fixed on the dev site from whatever point the copy was taken. On the dev copy we may be adding new channels, channel fields, changing templates etc.

I was wondering what the best way to manage keeping things in sync is, particularly from the ExpressionEngine database perspective? If we're changing channel fields in the dev database, we cannot simply replace the live database with the dev one when we want to update the live site with our changes. Because this will remove content that's been added to the live site (news in the example given above).

What strategies do people use in this situation? I noticed there is a feature in the EE Admin panel to export channel fields. But this doesn't seem to do what's needed. For example if I've changed channel fields on the dev site and export them, I can't import them on the live site as it will complain of duplicate fields. If I delete the channel, I lose the content.

We are not using any version control systems like git for this site, and I don't actually think that will help with database related things anyway?

2
  • related but old: expressionengine.stackexchange.com/questions/2173/…, might be better techniques now. Will be interested in answer.
    – AllInOne
    Nov 16, 2016 at 16:38
  • Thanks, I'd already read that. Unfortunately that example is focusing on one-way deployment (dev > live in this case). Using version control (like git) is really only suited to the filesystem. My issue is that I have 2 separate EE databases that are out of sync as well as the filesystem. Files are the least of my concern as in theory I could just diff the 2 structures. I'm really after a way of putting things on the dev EE Admin panel (channels, fields, etc) and then migrating these to the live site, without removing anything that's changed on the live site since the dev copy was made.
    – Andy
    Nov 16, 2016 at 16:42

1 Answer 1

4

My strategy is this: when building new features, plan out what new fields, channels, etc you'll need to use first. Then, add those to the production site. Populate them with any initial content if you have it.

(You can easily keep new, yet-to-be-implemented channels hidden from site admins by not assigning them to their member group.)

After that you can take an export of your site and import into your dev environment. Use those new channels and fields to build/change your templates, then simply push your template changes live when you're ready.

You should never be pushing a dev database to production, expect for in very rare cases when you've run a big upgrade or done a larger site revamp (and have had a content freeze on the production site in the interim).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.