# How to Diff Between Two Snapshots

**URL:** <https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789>\
**Category:** Radiant CMS\
**Created:** [November 30, 2007, 9:43pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789 "2007-11-30T21:43:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [November 30, 2007, 9:43pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/1 "2007-11-30T21:43:25Z")

</div>

One of my biggest painpoints with Radiant is figuring out what is  
different on my local copy and my test server’s copy and keeping them  
in sync. I think I just figured out a half-decent way to do it…

First you need to download the snapshot extension (search the mailing  
list). This creates a static snapshot of your entire site and put it  
in a folder called ‘snapshot’.

Install the extension in both Radiant installations.

Create snapshots of each (it outputs the whole site to  
${RAILS\_ROOT}/snapshot) and use ‘diff’ to compare them.

It’s a little tedious but I’m sure someone who is better at Capistrano  
could probably do this in a script.

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [November 30, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/2 "2007-11-30T21:54:33Z")

</div>

A caveat that I am seeing is that since you are diffing over the  
generated page, if you made any changes to your layouts, those changes  
are repeated on every single page.

It might be better if I could dump the layouts and pages seperately  
and then do a diff on them. I’ve tried just doing a diff of the  
database dumps and they are horrible.

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [December 3, 2007, 3:43am UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/3 "2007-12-03T03:43:58Z")

</div>

> First you need to download the snapshot extension (search the mailing  
> list). This creates a static snapshot of your entire site and put it  
> in a folder called ‘snapshot’.

You’d be better off using the import/export extension, completely  
shutting  
out the admin interface on your live site and only updating your live  
site through the import/export extension (though I’m not sure how  
production-ready that extension is).

Dan.

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [December 3, 2007, 1:17pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/4 "2007-12-03T13:17:09Z")

</div>

Yeah I thought about using that too. I haven’t tried yet to see what  
the diff would look like on the yaml.

What I would really like in the long run, is the ability to diff  
changes between two Radiant installations from the admin interface,  
and then basically apply a patch to the production server from the  
test server. This would be really useful so that users could try out  
a multiple-page/snippet change on the test server; then when they get  
approval or test it out, can just push the change to the production  
server as one transaction. I am going to see how far I can get with  
an extension that could do that. Without this solution, you either  
have:

1. people making live changes on the production server which could  
result in an inconsistent or buggy state
2. changes are too hard to make and require that you involve sys  
admins to move the test db over to the production db

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [December 3, 2007, 4:50pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/5 "2007-12-03T16:50:06Z")

</div>

An easy solution for this is to have Radiant installed locally on the  
customer side. The customer updates the site locally, tests the changes  
and  
when she is happy triggers a script which makes the deployment of the  
new  
database, via rsync, subversion or whatever. So the “master” db is in  
the  
customer side.

No diff in this case, but it’s worth the effort of implementing a  
complex  
diff system?

/AITOR

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [December 3, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/6 "2007-12-03T17:01:52Z")

</div>

That is what we are doing right now except we haven’t yet written a  
script for it.

However, I would really think the diff feature would be useful as you  
can make sure that on one else had made changes on the server before  
your changes and didn’t deploy them. The server I am working on has  
change rights for twenty, thirty people. If one person is making  
changes to pages A, B, C and another person is making changes to B, C,  
D it’s a little hard to see what change you are going to push to  
production without a feature like this. Come to think of it, it would  
also be nice to be able to put a lock on the system while one person  
is editing so that you couldn’t have this situation.

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [December 3, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/7 "2007-12-03T17:15:29Z")

</div>

On Dec 3, 2007, at 11:00 AM, Matt H. wrote:

> However, I would really think the diff feature would be useful as you  
> can make sure that on one else had made changes on the server before  
> your changes and didn’t deploy them. The server I am working on has  
> change rights for twenty, thirty people. If one person is making  
> changes to pages A, B, C and another person is making changes to B, C,  
> D it’s a little hard to see what change you are going to push to  
> production without a feature like this. Come to think of it, it would  
> also be nice to be able to put a lock on the system while one person  
> is editing so that you couldn’t have this situation.

I can certainly see the benefit of what your are proposing, but don’t  
see it as something that should be developed by the core team as it  
doesn’t fall within the realm of things that are important for a CMS  
for small teams (6-8 people). Consider developing an extension. There  
may be others here on the list who would be interested in lending a  
hand.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [December 3, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/how-to-diff-between-two-snapshots/121789/8 "2007-12-03T17:53:37Z")

</div>

I am working on it 🙂
