Jump to content
We've recently updated our Privacy Statement, available here ×

Import/Export, version numbers and comparisons


hirowla

Recommended Posts

Hi,

I was wondering how to do imports/exports without the version numbers being incremented whenever I do an import. What I'm trying to do is set our development environment back to what is in our production environment. But as soon as I do an import, all the version numbers increment and hence I cannot do the comparison. When I do the export, every file is different - only because of the version number.

Is there any way to do this type of comparison easily, without version numbers getting in the way?

 

Thanks,

 

Ian

 

 

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

I'm thinking of the version numbers that each object has, not the version of the product. It seems to increment these versions every time, which is annoying because I can no longer compare easily whether objects have changed (because after every import, they all have!).
Link to comment
Share on other sites

 I had the same problem to version reports and i solved it with a script.

I had to version my reports on IBM Rational ClearCase, but every export/import was different due to some values into jrxml and into other xml files, so also if two files were the same, everytime CC creates a new version of them.

If you use iReport, it writes some useless properties into jrxml, read this to remove them.

My script does it:

  1. export all reports from JasperServer into a dir (not a zip file)
  2. overwrite all <version> and <creationDate> tags into all *.xml files in all sub-directories with default values, I chose respectively "0" and "2010-01-01T00:00.000+00:00" (I used a sed command with Cygwin on Windows XP)
  3. now exported files and versioned files are different only for file timestamps (creation/modification date) and for real changes. To copy only files really changed into versioning directory I use a rsync command that compare files only using their checksum.

If you want only to do a easy compare try diff softwares like WinMerge (freeware for Windows).

With WinMerge:

  1. export all reports from development environment into a directory
  2. export all reports from production environment into another directory
  3. open WinMerge
  4. click on File -> Open...
  5. select Left (development ) and Right (production ) directories and click OK. You will see all differences between every pair of files
  6. Go to Tools -> Filters... and Linefilters tab
  7. create two line filters (New, write and Save and finally click OK):
    • <version>(.*)</version>
    • <creationDate>(.*)</creationDate>
  8. Go to Edit -> Options -> Compare -> "File Compare method:" and select "Full Contents" instead of "Quick Contents"
  9. Refresh view with F5
     

 

Link to comment
Share on other sites

 Very nice and useful post :-)

It might be a good feature to add to the export. Something like "--skip-date-create" (which would skip these variable date values and any other values that vary in a similar way). Can make a request on the tracker which makes it easier to get into the queue. 

Link to comment
Share on other sites

Thanks for the help. I'm glad I'm not the only dealing with this.

Now all I have to get is WinMerge to help me do the diffs (I've set it up like you said but it has no effect).

I think I'll end up writing some code to alter every single file to ensure the dates are the same, but I do any diffs etc. If you have your sed script handy that would be good too!

Thanks,

Ian

 

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...