Reset the database
It is often useful to restart RadGrad with a new database. This involves:
- Stopping the current RadGrad service.
- Dropping the MongoDB RadGrad database.
- Edit the settings.json file to point to the new database to load on startup.
- Update the settings in mup and restart the RadGrad service.
1. Stop RadGrad
First, stop the RadGrad service:
Sample invocation and results:
2. Make backup of current database
warning
The following command, although taken straight from the meteor up documentation (http://meteor-up.com/docs.html#backup-and-restore), did not work for me:
Where "root@host" is replaced by the one appropriate for your instance, such as "radgrad@radgrad2.ics.hawaii.edu" or "root@radgrad-comp-eng.design".
So, to make a backup, you should login as an administration and use the "dump database" option.
3. Drop database
Next, drop the database by invoking this command:
If you are not deploying the ICS instance of RadGrad, then you need to substitute a different user for radgrad@radgrad2.ics.hawaii.edu
in the above command.
For example, in the case of the Computer Engineering instance, the user is root@radgrad-comp-eng.design
.
In either case, you will be prompted for the associated password in order to complete the ssh login process and execute the drop database command.
Sample invocation and results:
4. Edit settings
Presumably you are dropping the current database in order to load a new snapshot of the database.
To do this, edit the app/.deploy/settings.json file to specify the new database.
This usually involves changing the value of the field "databaseRestoreFileName".
5. Deploy with updated settings
Next, invoke mup deploy to rebuild and redeploy RadGrad.
Sample invocation and results:
6. Check status of deployment through logs
To ensure that what you wanted to have happen actually happened, check the logs with mup logs:
Sample invocation and results:
7. Run mup logs, record new admin password!
Record new admin password!
Note that when you start up the system with a new database, a new admin password will be generated and the log file will be the only place it is made available. The log is only available until the next deploy of the system, so be sure to invoke mup logs
, find the log message with the new admin password, and record it someplace safe.