Rolling back after a failed upgrade
Before you use the backup to recover Unravel, refer to the following sections in the Troubleshooting guide for recovery without backups:
To roll back after a failed upgrade, you need to follow these steps:
- Back-up data. - The following steps cover offline backups where Unravel must be entirely stopped. You can backup the internal database as well as the external database. - Backing up when using an internal database - Stop Unravel - <Unravel installation directory>/unravel/manager stop
- Back up the files. - tar czf /backup/tar.gz <path/to/data> ##Example tar czf /backup.tar.gz /opt/unravel/data 
- Start Unravel. - <Unravel installation directory>/unravel/manager start
 
- Backing up when using an external database - Stop Unravel - <Unravel installation directory>/unravel/manager stop
- Back up the files. - tar czf /backup/tar.gz - <path/to/data>- For example: tar czf /backup/tar.gz /opt/unravel/data 
- Use your database backup tools to make a backup of the database. - Ensure to back up the stored procedures using the --routines switch. For example, for MySQL, run the following command: - <mysql_dir>/bin/mysqldump -u- [username]–p- [password]--routines- [database_name]> [dump_file.sql]
- Start Unravel. - <Unravel installation directory>/unravel/manager start 
 
 
- Restore backup. - Note- You can restore the backup on a server with the same name. Also, ensure that Unravel should be run with the same user. - Deploy the Unravel software. - Caution- Ensure to deploy the exact version of the software used for the backup. If you do not know what version was deployed, look in the backup for - data/conf/current.yamlfile to find the version information.
- Extract the backup tarball to where you have deployed Unravel binaries. For example, if you have deployed Unravel software to - /opt/unravel, then run the following command:- tar zxf /backup/tar.gz -C /opt/unravel - External database note: If you are using an external database, use the database backup tools to recover the data. - At this point, the - /opt/unraveldirectory contains the recovered data directory and the newly installed software in- versions/<unravel version>.- Ensure that the data is on the same server and schema and must be accessed with the same credentials. If any of this differs, update the database: block in - unravel.yamlbefore completing the recovery.
- Run the command to restore. For example, for MySQL, run the following command: - mysql -u [user] -p [database_name] < [filename].sql 
 
- Run the following command to roll back to the previous version. - For example: - /opt/unravel/versions/4.7.9.2.2048/setup --config /opt/unravel/data/conf/unravel.yaml 
- Start Unravel. - <Unravel installation directory>/unravel/manager start