Home > Coding, GNU/Linux, Heroku > backup dan sync database dari aplikasi di heroku

backup dan sync database dari aplikasi di heroku


backup

syntax:

heroku db:pull sqlite://nama-backup.db --app nama_aplikasi

sync

syntax:

heroku db:push sqlite://nama-db.db --app nama_aplikasi

jika opsi –app tidak disertakan, maka aplikasi yang dipakai adalah aplikasi yang berada pada heroku info.

real worlds:

sopir@debian:~/fix$ heroku db:pull sqlite://mainpagedeanet-backup.db --app mainpagedeanet
Loaded Taps v0.3.9
Warning: Data in the database 'sqlite://mainpagedeanet-backup.db' will be overwritten and will not be recoverable.
Are you sure you wish to continue? (y/n)? y
Receiving schema
Schema:        100% |=======================================================================================================================| Time: 00:00:42
Receiving indexes
schema_migrat: 100% |=======================================================================================================================| Time: 00:00:01
Receiving data
9 tables, 28 records
items:         100% |=======================================================================================================================| Time: 00:00:04
open_id_authe: 100% |=======================================================================================================================| Time: 00:00:02
comments:      100% |=======================================================================================================================| Time: 00:00:05
schema_migrat: 100% |=======================================================================================================================| Time: 00:00:05
stars:         100% |=======================================================================================================================| Time: 00:00:10
open_id_authe: 100% |=======================================================================================================================| Time: 00:00:02
users:         100% |=======================================================================================================================| Time: 00:00:15
categories:    100% |=======================================================================================================================| Time: 00:00:01
open_id_authe: 100% |=======================================================================================================================| Time: 00:00:01
Resetting sequences
sopir@debian:~/fix$

sync database ke dyno apps heroku:

sopir@debian:~/public_html$ heroku db:push sqlite://blog.db
Loaded Taps v0.3.9                                                       
Warning: Data in the app 'sopir' will be overwritten and will not be recoverable.
Are you sure you wish to continue? (y/n)? y                                      
Sending schema                                                                   
Schema:        100%                                                              
|=======================================================================================================================| Time: 00:00:02
Sending indexes                                                                                                                         
Sending data                                                                                                                            
1 tables, 0 records                                                                                                                     
posts:         100%                                                                                                                     
|=======================================================================================================================| Time: 00:00:00
Resetting sequences                                                                                                                     
sopir@debian:~/public_html$                                                                                               
Advertisements
Categories: Coding, GNU/Linux, Heroku Tags:
  1. September 9, 2011 at 8:07 am

    mantap nic share..
    trimakasih gan atas sharenya alhamdulillah sangat bermanfaat 😀

  2. November 26, 2014 at 11:14 am

    makaish banyak atas info yang telah di berikan akan saya praktekan

  3. December 18, 2014 at 10:11 am

    datanya lengkap sekali makasih infonya

  4. January 15, 2015 at 9:38 am

    keren databasenya

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s