2

A common workflow for me when building a web page is the following.

  1. I'm getting a PSD-file (Photoshop) from a external advertising agency
  2. Build the site in Webflow and then export to plain html/css/js
  3. Build the site locally in Craft CMS using Textmate
  4. Deploy to dev.customer.com using DeployBot and Github
  5. Send username and password for Craft to advertising agency, they then start to fill the site with content

The problem with this workflow is when the agency in step 5 want changes (new fields, sections). I don't want to add fields on both localhost and dev.customer.com. And I don't want to temporarily shut down dev.customer.com, export database on dev.customer.com to localhost and then import to dev.customer.com when done (there is often a tight schedule).

How would you do? Does Craft 3 solve this? If not, maybe me and the agency should work on the same codebase and database. One way is to have a small server locally (which i don't have) turned on 24h and open port 80 from outside so the agency could work in Craft. Another way is to use SSHFS to mount file system over SSH on a remote Linux VPS (which i have plenty of), but i'm not sure how stable this is.

2

You could open up the db used by dev.customer.com for external access and connect to it from your local dev environment.

  • 1
    So when a customer wants 10 new fields, you add it to dev.customer.com, pull down db. Make code changes locally and deploy? – Magnus Aug 18 '16 at 5:51
  • Sorry for the confusion. All I wanted to say is that I usually don't use a shared db while the site is in development. Instead I do what you mentioned in the question, content freeze, export from stage server, changes locally, import to stage again. – carlcs Aug 18 '16 at 6:13
  • Well i think your solution (as i understood it :) ) sounded good. The customer can keep on working while i add minor changes. If the customer then wants bigger changes i can content freeze dev.customer.com. So thanks! – Magnus Aug 18 '16 at 7:19
8

Essentially the question is "how can I manage changing database content across environments" which has been covered several times here before. Some leisure reading:

What's the best practice for handling data migration and organization across development environments?

Git Workflow and Multi Environment - how to approach

What's the best practice for upgrading a versioned Craft site?

Does Craft 3 solve this?

Craft 3.0 will not have a solution for this at launch, but we are planning on something post 3 launch that will help making managing Craft content across environments easier to manage.

  • 2
    Regarding content model export/import, it might be worth checking out the following plugins: Schematic, Art Vandelay, Field Manager – Mats Mikkel Rummelhoff Aug 17 '16 at 9:17
  • Thanks Brad. I have read those earlier. The question don't have to be "how can I manage changing database content across environments". The question can be more like "When developer X on a one-man firm take care of the design and development of an content empty site for a client, what is then the best workflow? Knowing that when the client start to fill the site with content, they want to have field changes and so on" For example, is it totally wrong to skip git and local database and instead code directly on the server? How would you do Brad? – Magnus Aug 17 '16 at 16:38
4

At step 5 you basically start working with another person. Their content input is just as important as your code changes.

Therefore you'll need to alter the workflow as

Code flowing in "Local > Staging > Production" direction

and

Database flowing in "Local < Staging < Production" direction

1

My suggestion would be to do what is outlined in Database & Asset Syncing Between Environments in Craft CMS

It's a little bit of logistical organization coupled with some scripts to do the asset/db synchronization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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