Textpattern Forum

You are not logged in. Register | Login | Help

#21 2011-09-25 22:04:59

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

Re: Working with live and development sites

Els wrote:

Hi Giuseppe, have you seen this recent thread? Maybe it helps, it’s more or less about the same issues.

Hi Els, thanks so much for the link, I didn’t see it.

More or less, it is the same issue. We are really trying to find a solution since working on live sites it’s not a viable way on more complex site in any case.

Currently, we are testing a possible solution considering that the only content created in Production are blog articles.
We created a MySql trigger function to mirror articles created in Production to Development. Then we created a script to migrate Development to Production when ready.
We are also considering to use cnk_versioning to manage structure so that we’ll just move its folder structure from Development to Production after we tested edits to migrate.

What do you think about it?
Do you think cnk_versioning could help in keeping structure more separated from content1?
Which TXP content/folders can be centralized to ease migrations? Images folder? Css folder?
Could a multi-site installation help in any way?

Thank a lot as always for your help, it is much appreciated. :)

1 btw, keeping all in texpattern table doesn’t help…

Edit:
Added MySql trigger functions reference link

Last edited by caruso_g (2011-09-25 22:11:17)

Offline

#22 2011-09-25 22:10:03

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

Re: Working with live and development sites

Hi, I am sorry, I didn’t see this post and I opened a new thread in “How do I…?” section.
Please, take a look at it , I hope that can help.

(Topics were merged. -Els)

Last edited by Els (2011-09-25 23:17:20)

Offline

#23 2011-09-26 01:49:07

hakjoon
Moderator
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,631
Website

Re: Working with live and development sites

Algaris wrote:
The only drawback I can think of is it would make updating the site I work on impossible when out of the office.

Yeah the ideal situation would be to be able to move things between any installation that way you could work on live if needed and migrate the stuff back, or work on test or dev. It only really gets tricky when using ids to reference content like images, files or specifying articles by id. It would be nice to move to guids or something to alleviate that but that brings it’s own issues.

Still trying to think through it to see what can be done. I’ve worked with stuff like this before but we always targeted multiple environments from the get go so the DB was setup to handle that.


Shoving is the answer – pusher robot

Offline

#24 2011-09-26 19:33:30

scornflake
New Member
Registered: 2011-04-28
Posts: 4

Re: Working with live and development sites

hakjoon – I’m curious. What issues do you foresee moving to a guid (or simply synthetic ID) based approach?

.

Offline

#25 2011-10-12 08:24:21

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: Working with live and development sites

In order to try and simplify my updating process until Sam’s Escher’s branch features (hopefully) become part of Textpattern 5 I’ve been looking at different options.

Currently when working with my local and remote installations of TXP I try to keep all articles, images, files and links in sync with each other so as to avoid any possible confusion with ID numbers. Typically I’ll use the local version as my master. When ready to push major updates out I’ll make back ups of both the local and remote database and FTP my Images and Files directories to the remote site. I then drop the remote database, import the local database and change the file locations in Textpattern’s preferences. Normally this process works fine and only takes a minute or two but it’s not a lot of fun and can be pretty hairy (I really don’t like messing around with the databases). The fact that the whole website is offline or appears broken to visitors during this time is another reason I’m not happy with the process.

Recently I came across this software http://www.zennaware.com/cornerstone/index.php which uses Subversion. Is this something that I could use to push updates to the remote server? Given that TXP stores its Pages, Forms and Articles, etc. in a mySQL database I’m not sure how easily it could be synced and I would still have to manually update my TXP preferences for the file locations.

Offline

#26 2011-10-12 09:40:42

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,924
Website

Re: Working with live and development sites

While using svn for versioning files is fine, I don’t think you can use svn to sync MySQL databases (except for db-dumps), but I could be mistaken.

You can slightly simplify your db transfer by dropping and replacing only individual tables of the databases so that you don’t have to reset your prefs. Alternatively use adi_prefs to store local and remote prefs sets and switch between them or an sql dump of just your prefs which you can use to reinstate them after a db-update.

From googling I found two projects that attempt to address the problem of migrating mysql databases:

Maybe others can provide a more qualified reply or these links are useful pointers for further investigations.


TXP Builders – finely-crafted code, design and txp

Offline

#27 2011-10-12 10:27:05

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: Working with live and development sites

Thank you for your reply. Well I guess SVN might be useful to keep files, images and my JS folder in sync between the local and remote servers. It’s a pity (but not unexpected) regarding mySQL syncing. I wonder if I could set something up where I export my local database (using adi_prefs for the remote preferences), upload the db-dump with the rest of my site via SNV and then import the db-dump using rss_admin_db_manager to avoid dropping tables and any downtime.

Ideally what I’d love would be a one click solution where my database is pushed to the remote site with all the correct preferences, no messing around with import/export, dropping tables and most importantly no downtime.

Offline

#28 2011-11-23 10:07:14

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: Working with live and development sites

After some major headaches trying to keep our Development and Live sites in sync I finally caved in and set up new Development and Staging copies of the website.

I updated the website last night using this method and it almost had me longing for our old website which was updated using Dreamweaver. If I wanted to make a structural change I downloaded the file to a localhost copy of the site, edited it and then pushed it back to the live site all via Dreamweaver’s file management window. Two clicks (one to download, one to upload) and that was it the changes were live.

With Textpattern if I want to work locally I have to:

1. Make the changes to the development copy of the website.
2. Copy the Live site to the Staging site.
3. Export the CSS, Forms and Pages tables from the Development site.
4. Drop the CSS, Forms and Pages tables from the Staging site.
5. Import the Development CSS, Forms and Pages tables into the Staging site.
6. Test the Staging site.
7. Fix any bugs on the Development site.
8. Repeat steps 3-5.
9. Export the CSS, Files, Pages tables from the Staging site.
10. Enable rvm_maintenance on the Live site.
11. Drop the CSS, Files, and Pages tables from the Live site.
12. Import the Staging CSS, Files, and Pages tables into the Live site.
13. Test the updated live site (and hope that nothing went wrong)
14. Disable rvm_maintenance.

There has to be an easier way to work than this. I’m dreading the day I have to rush out an emergency fix. I guess I’ll have to bite the bullet and work straight on the live site for this, which I dislike doing for numerous reasons.

After going through this process I really hope that Sam’s Branch feature from Escher is made part of the Textpattern 5 core. It’s number one on my Textpattern wish list right about now.

Offline

#29 2011-11-23 11:53:27

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,924
Website

Re: Working with live and development sites

Maniqui has come up with a somewhat elaborate but rather clever system for a few of us on the forum who have been working together. The basic principle is as follows but maniqui can elaborate in detail.

  • We’re using cnk_versioning throughout so that the forms, pages and css can be stored in a file versioning system. In this particular case it’s git-based with a central repository on beanstalk but the same principle should work with other cvs systems.
  • The main online repository is essentially the staging / develop site and is hosted with beanstalk.
  • The live site is a remote copy of the staging site that is updated manually by pulling across the changes from the staging site.
  • Each person working on the site has a local installation in a virtualhost on their computer linked to their git-monitored local working copy of the repository.
  • Certain config files specific to the local / staging / live sites are excluded from the versioning process.

It takes a bit of setting up, and maniqui has it set up even more cleverly than I can explain, but once it is in place, each person involved on working on a site has the same set of files on the computer and staging site. You can develop and test locally, then commit the changes you make to the online repo (the staging site). Here you can coordinate with others and when everything’s been tested to completion, the changes are then pulled across to the live site.
You could also use the branching possibilities offered by git and co to keep multiple branches of the same repo on the go (e.g. develop, live, new-feature-x, new-feature-y, bugfix) and then merge these together when the new feature has been completed or the urgent bug is fixed. Most of this was born out of the need for several people to work on a single site, so it can probably be simplified somewhat for a one-person operation.

What isn’t versioned at present is the DB, though. adi_prefs or a small custom block of importable sql makes it possible to export/import the db and then overwrite specific tables with local setup config information (alternatively don’t import/export all the tables).

———

A poor man’s alternative: for my own stuff I don’t generally need an interim staging site, but do work from different computers (at work / at home). I use Espresso as my preferred code editor (IIRC you do too) and stick my template files and some other key files such as css/js etc. into a folder that is synced via DropBox between my machines. That folder can be the basis for my local virtualhost container, or you can “plug” these directories via a symlink to your own virtualhost container elsewhere in your file system.

Espresso allows you to attach several online ftp servers to a single site and control when saving a file syncs to the online repo or not. You can develop locally just by saving the files. When you’re ready to upload the changes, switch on sync with the online server and either re-save the files or use Espresso’s sync function (depending on how much you changed). As you can attach more than one server, you could theoretically add a staging ftp and a live ftp to your local Espresso project. You do need to leave your online site on “testing” production status, though.


TXP Builders – finely-crafted code, design and txp

Offline

#30 2011-11-23 12:15:44

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: Working with live and development sites

Wow thank you for this post jakob. It’ll take me some time to ruminate over what you’ve said. I definitely would be interested in reading more from maniqui regarding this setup.

Currently I find designing a website in Textpattern as well as updating it with new content to be a pure joy. And I love the community so much. Maintaining a development copy however is a pain in the ass.

You remember correctly I do use Espresso. Currently my setup is:

cnk_versioning
Espresso
LESS.app (http://incident57.com/less/) I will however be upgrading to Code Kit at some point (http://incident57.com/codekit/)
Transmit for pulling content from the Live site to the Staging site (I love being able to mount an FTP server as a disk)

All of my development work is done on an internal server where I work which unfortunately isn’t accessible to the outside world.

I have been looking at versioning. I started with a trial of Cornerstone a little bit back but recently stumbled a cross http://www.git-tower.com I have to admit I’d rather use a client on my Mac for this kind of thing. I still have a way to go as I don’t fully understand the all concepts regarding versioning yet.

Offline

Board footer

Powered by FluxBB