Author Topic: Dev Environment to Production Environment  (Read 594 times)

thomaswrench

  • Full Member
  • **
  • Posts: 6
Dev Environment to Production Environment
« on: February 27, 2015, 08:59:12 am »
We are using Blubrry for posting sermons at our church, and we have always just 'cowboy'd' it and did everything on the live environment.

Since we are getting ready to relaunch our new site, I am setting a structure in place to make all page content, plugin, theme changes, etc to the dev environment, test, then push the changes to the live site.

We are using WP Sync DB (https://github.com/wp-sync-db/wp-sync-db) to push the database changes and media to the live server.

My question is, what would be best practices when it comes to posting our podcast?

If we create the post on the dev site, using blubrry, then the podcast would be sent to iTunes in a bad feed, and then if we push to production, there could be a duplicate podcast being sent.

If we create the blubrry posts in production, then we push other, non-related updates, it will overwrite the tables on production, thus removing the live podcasts...

Just looking for some help in how to accomplish this. Thanks in advance!
« Last Edit: February 27, 2015, 09:03:47 am by thomaswrench »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Dev Environment to Production Environment
« Reply #1 on: February 27, 2015, 10:20:35 am »
Can you explain what you mean by "cowboy'd it"? Is this a phrase for writing content on one place then pushing it to another place? I'm not familiar with the term in the context.

I would never treat the content you write into blog posts/pages as dev content. You should use WordPress as a CMS directly.

Are you aware WordPress has built in CMS features to save posts in different states? You can preview your work, until you click "Publish" no one publicly will see it. You can also setup complex "roles and capabilities" where some users cannot change the state of posts and others like copywriters and administrators can. Furthermore, revisions are saved every time changes are made, unless you turn this feature off.

I see you have the database figured out, but I also going to guess you haven't dealt with images and other attachments within blog posts and pages. The wp-content/uploads folder will also need to be synced in your situation, and then the database updated to use the new URLs rather than the Dev ones to those files in the wp-content/uploads folder.

Usually a separate dev site (or staging site) is used to stage the package of themes, plugins and settings for testing or theme/plugin development purposes. The content itself in a staging environment uses Greeking (Lorem Ipsum) and does not actually use real post/page content. There is actually a default database you can use from WordPress development for testing themes and plugins with that do not rely on your actual content but of a set of various types of content that's best suited for testing different situations.

Another common practice is to create a sandbox of a future site, you create the actual content on this site and when the release date comes, you do a one-time migration of the database, wp-content folder to the new domain. Such a move requires you to then use a find and replace tool to update all the URLs to the images saved in the wp-content/uploads folder, and also requires you to either set defines in your wp-config.php or update the appropriate DB fields of your web site's home_url and site_url. This is a tedious process, it's only done for such situations when you are switching to a brand new web site, it is not something you want to do on a daily basis every time you create a new blog post or page.

What is the reason for this procedure of keeping a dev and live site in sync? Perhaps if you can explain the reasoning behind it then I can give you better advice.

As far as blubrry hosting is concerned, you can publish from a dev site and then mirror that site to another site. We have done this with sandboxes for clients as described above, we just didn't repeatably clone a site over on a daily or weekly basis as you're describing. As long as the feed URL you submitted to iTunes is to the mirrored site (not the dev one) then that is the site the feed is from everything will work as you want. So as long as the wp-sync-db plugin copies all of the postmeta table you should be fine. Just keep in mind if you kept with that scenario, the feed itunes pulls will never have the new episode until you run your wp-sync-db.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Dev Environment to Production Environment
« Reply #2 on: February 27, 2015, 10:32:11 am »
I see the WP Sync DB has an addon module to sync the media files. So as long as you use that as well, and it updates the media URLs then you could keep with the solution you have. As long as the podcast feeds you submit are from your live site then you should be all set as far as iTunes is concerned.