简体   繁体   中英

How to get the DATABASE_URL from a rails project on cloud9

I have a rails project running on cloud9, and I want to dup it to my local machine so I can continue working on it locally.

The problem however is that I have data on cloud9 database already which I'll like to continue utilizing, either while on cloud9 or on my local machine.

I know that including DATABASE_URL in my env vars for the project will ensure that the app connects to the specified database as stated here .

To this end, my question is this:

How can I get the database url being used on the cloud9 instance, so I can just use it directly from my env vars on my local machine? or... is this not possible?

I'm pretty sure that database on cloud9 is only available from inside the cloud. To replicate the setup on a local machine you would have to set up your own database

To dump the database on cloud9 you can use pg_dump in the cloud9 terminal, and then pg_restore on your local machine (or vice versa to move the dump from your local machine to cloud9)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM