# Migrate mysql rails 2 to rails 3?

**URL:** <https://www.ruby-forum.com/t/migrate-mysql-rails-2-to-rails-3/222820>\
**Category:** Deployment\
**Created:** [September 11, 2012, 7:35pm UTC](https://www.ruby-forum.com/t/migrate-mysql-rails-2-to-rails-3/222820 "2012-09-11T19:35:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 11, 2012, 7:35pm UTC](https://www.ruby-forum.com/t/migrate-mysql-rails-2-to-rails-3/222820/1 "2012-09-11T19:35:35Z")

</div>

I have an old rails project that is currently in Rails 2.3

I’m about to undertake updating the project to Rails 3.2.

The old project’s production server is on mysql 5.0 and has a medium  
size database (not huge, but certainly big enough that I need to keep  
the data after I upgrade the app).

If I do a modern deployment of Rails 3.2 (apache and latest stable mysql  
on latest suse linux) I’m wondering if I will be able to just copy the  
db over from the old server, or if there will be a need for some sort of  
a migration?

Any info on what I’m up against there will be much appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [November 27, 2012, 2:49am UTC](https://www.ruby-forum.com/t/migrate-mysql-rails-2-to-rails-3/222820/2 "2012-11-27T02:49:38Z")

</div>

Jeff P. wrote in post #1075505:

> I have an old rails project that is currently in Rails 2.3
> 
> I’m about to undertake updating the project to Rails 3.2.
> 
> The old project’s production server is on mysql 5.0 and has a medium  
> size database (not huge, but certainly big enough that I need to keep  
> the data after I upgrade the app).
> 
> If I do a modern deployment of Rails 3.2 (apache and latest stable mysql  
> on latest suse linux) I’m wondering if I will be able to just copy the  
> db over from the old server, or if there will be a need for some sort of  
> a migration?
> 
> Any info on what I’m up against there will be much appreciated.
> 
> Thanks!

maybe you may put below in ‘app/config/database.yml’ :

development:  
adapter: [database] . . . ex:mysql or mysql2 or sqlserver  
database: [database name] (mine : work\_development)  
username: [login to database username]  
password: [login to database password]  
pool: 5  
timeout: 5000  
socket: /var/run/mysqld/mysqld.sock

test:  
adapter: [database engine] . . . ex:mysql or mysql2 or sqlserver  
database: [database name] (work\_test)  
username: [login to database username]  
password: [login to database password]  
pool: 5  
timeout: 5000  
socket: /var/run/mysqld/mysqld.sock

production:  
adapter: [database] . . . ex:mysql or mysql2 or sqlserver  
database: [database name] (work production)  
username: [login to database username]  
password: [login to database password]  
pool: 5  
timeout: 5000  
socket: /var/run/mysqld/mysqld.sock

after that , bash the code in terminal :  
rake db:migrate  
rake db:schema:load

i hope it can solve your problem.

Edy
