Forum: Rails deployment migrate mysql rails 2 to rails 3?

8dad1ec4d769734583f45fbbee5cd009?d=identicon&s=25 Jeff Pritchard (jeffpritchard)
on 2012-09-11 19:35
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!
B52fec9bb4acfe93d31cc953048c2ccd?d=identicon&s=25 edy lim (dysto93)
on 2012-11-27 02:49
Jeff Pritchard 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
This topic is locked and can not be replied to.