15.3. Restoring from an Application Snapshot

Restoring from an application snapshot restores the Git repository, the application data directories, and the log files found in the specified archive. When the restoration is complete, the deployment script is run on the restored repository as though git push was run.

Warning

The rhc snapshot restore command overwrites the remote Git repository. Therefore, any changes made since taking the snapshot are lost. Importing snapshot data into a local environment can delete local content, for example a user table in a database. If you are unsure of the effect a snapshot import could have on local data, use SSH to access an application and create the backup directly.
Restore an application from an application snapshot with the following command, specifying the name of the application:
$ rhc snapshot restore App_Name

Example 15.3. Restoring from an Application Snapshot

$ rhc snapshot restore myapp
Restoring from snapshot myapp.tar.gz...
Removing old git repo: ~/git/myapp.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/App_Name.git and ~/app-root/data
Activation status: success

RESULT:
Success
If the override process was used to save an application under a different filename, as described in Section 15.2, “Creating an Application Snapshot”, you can restore this snapshot version of an application with the following command:
$ rhc snapshot restore App_Name --filepath Renamed_App
where App_Name is the name of the application, and Renamed_App is the file path where it was saved.