# Migration between versions

**URL:** <https://www.ruby-forum.com/t/migration-between-versions/128380>\
**Category:** Rails\
**Created:** [February 7, 2008, 7:16am UTC](https://www.ruby-forum.com/t/migration-between-versions/128380 "2008-02-07T07:16:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [February 7, 2008, 7:16am UTC](https://www.ruby-forum.com/t/migration-between-versions/128380/1 "2008-02-07T07:16:56Z")

</div>

Hi

how to migrate in between versions ?  
suppose if i have version 1-76 .

if i want to revert from 57-65 then what should i do ?without affecting  
data of migrations from 66-76.Please help

Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [February 7, 2008, 10:15am UTC](https://www.ruby-forum.com/t/migration-between-versions/128380/2 "2008-02-07T10:15:03Z")

</div>

‘rake db:migrate VERSION=x’ (where ‘x’ is the migration number)

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [February 7, 2008, 10:35am UTC](https://www.ruby-forum.com/t/migration-between-versions/128380/3 "2008-02-07T10:35:20Z")

</div>

Is it correct?Because rake db:migrate VERSION=57(mycase) will drop all  
tables from 76-58…So my data in 66-76 will be lost.That is not neede.I  
have to preserve data of 66-76

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [February 7, 2008, 11:20am UTC](https://www.ruby-forum.com/t/migration-between-versions/128380/4 "2008-02-07T11:20:39Z")

</div>

I’m not sure if it is possible to do what you want using rake. Generally  
speaking in the development environment, while data loss can be  
inconvenient  
the data is rarely considered to be crucial - the critical data is what  
is  
used in the production environment.

If you really do have to save what you have in the tables that would be  
lost, you can backup the data from the database and then restore it once  
rake recreates the empty tables. The method to do this depends on which  
database platform you are using, with MySQL for example you would use  
mysqldump.

Gareth

* * *

Gareth Howells, CertHE (Dunelm), BCS  
CEO, GForce Industries

garethATgforce-industriesDOTcoDOTuk  
07862725134

GForce Industries  
86, Warwick Avenue,  
Quorn,  
Loughborough,  
LEICS.  
LE12 8HE  
----- Original Message -----  
From: “Sijo Kg” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, February 07, 2008 9:35 AM  
Subject: [Rails] Re: migration between versions

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [February 8, 2008, 5:05am UTC](https://www.ruby-forum.com/t/migration-between-versions/128380/5 "2008-02-08T05:05:28Z")

</div>

Hi  
Thanks
