Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Pushing code changes to a live site


Reply

4 Posts   1067 Views

Avatar
purplespider

5 July 2010 at 10:36pm Community Member, 81 Posts

I was wondering how people go about pushing code changes to a live site. Currently I:

1 Test the changes on my local staging version of the site
2 Uploaded the changed files
3 Quickly rebuild the database once the uploads are complete
4 Hope nothing's gone screwy!
5 Then manually perform any CMS actions to use the changes, such as new pages etc

Is this how others do it?

Is there a better way? Avoid users accessing the site before the database has rebuilt?

Do you lock the site during updates? If so how?

Interested to hear how everyone does it.

Many Thanks
James

Avatar
TotalNet

6 July 2010 at 11:47am Community Member, 181 Posts

4 Hope nothing's gone screwy!

A database backup is always a good idea before you get to this stage ;)

Do you lock the site during updates? If so how?

There are a few ways, rewrite rules are the best way. you can have a ruleset before the SilverStripe stuff that checks for the existence of a file, e.g. closed-for-maintenance.html, redirect all requests to that page with an appropriate HTML status code (e.g. 307 Temporary Redirect).

As for the whole process, a good stating point is source control, svn. Then it really depends on the scope of the change; is a db rebuild necessary? are you making changes to existing {Data}objects. And the most important thing is a roll-back plan, be sure you can put everything back the way it was 5 mins ago.

Avatar
purplespider

6 July 2010 at 8:21pm Community Member, 81 Posts

Perfect, thanks.

My server does full backups each night, and I do a manual backup if I think large changes have been made.

Regarding SVN, it's something I've tried to fit into my workflow many times (only using TimeMachine at the moment), but it's never stuck. From a SilverStripe site's root, which directorys/files should be in the repositry, and which are best to skip from SVN, assets etc?

Thanks
James

Avatar
Willr

6 July 2010 at 8:40pm Forum Moderator, 5511 Posts

I have all my SS core folders and modules as svn externals. The whole site is in svn but those folders are externals and the only folders which aren't externals are the 'mysite', 'assets' and 'themes' folders but mysite and themes are stored in svn.

Externals documentation: http://svnbook.red-bean.com/en/1.0/ch07s03.html