Forum: Ruby on Rails Change Database Name

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0a87fb6bf40485e5a22b9c64a464e83b?d=identicon&s=25 Dan Weaver (jgoggles)
on 2009-01-28 18:33
Hi,

I'd like to change the name of the database for an app I have in
production (the current name is too ambiguous). As I see it I will need
to change the database.yml file and the database name in mysql. Is there
anything else? A better way? Suggestions?

I want to be on the cautious side, for obvious reasons.

Thanks.
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2009-01-28 18:51
(Received via mailing list)
Dan Weaver wrote:
> Hi,
>
> I'd like to change the name of the database for an app I have in
> production (the current name is too ambiguous). As I see it I will need
> to change the database.yml file and the database name in mysql. Is there
> anything else? A better way? Suggestions?
>
> I want to be on the cautious side, for obvious reasons.
>
> Thanks.

You could copy the database to the new name, and then change
database.yml.

Then you can delete the original database without any downtime.

HTH

Matt
0a87fb6bf40485e5a22b9c64a464e83b?d=identicon&s=25 Dan Weaver (jgoggles)
on 2009-01-28 18:55
Matt Harrison wrote:
>
> You could copy the database to the new name, and then change
> database.yml.
>
> Then you can delete the original database without any downtime.
>
> HTH
>
> Matt

Good suggestion, thank you.
This topic is locked and can not be replied to.