Before upgrading SaltStack Config, you should always back up your data. The following sections explain which data needs to be backed up so that it can be restored after you complete the upgrade process.
Back up SaltStack Config files and directories
The following files and directories contain your custom SaltStack Config configurations and need to be backed up before upgrading:
- On the RaaS node, back up these entire directories:
pkidirectory contains hidden files, so ensure you back up the entire directory.Backing up the log files in the
/var/log/raasdirectory is optional. During the upgrade process, you’ll clear the log files to provide a clean log file if troubleshooting is necessary.
- On each Salt master, back up the
Depending on how you initially installed SaltStack Config, the eAPI Salt master paths could instead be in the
After backing up the SaltStack Config and Salt master files, proceed to the next section.
Back up your database schema
When upgrading your RaaS node, the database schema is updated. For that reason, ensure you create a backup of your database before the upgrade.
To back up your database you need to first look up your PostgreSQL database name and then copy the contents:
- On the PostgreSQL server, back up these files:
- Log in as the
postgresuser using the following command:
sudo su - postgres
- Get your database name, using the following commands to enter PostgreSQL and then list the databases:
- To exit PostgreSQL and log out as the
postgresuser, press Ctrl+D and then run the following command:
- Copy database contents to a file. The following command gives an example:
pg_dump -U salt_eapi raas_db_name > postgres_raas_backup_$(date +%Y-%m-%d).sql
Your database files are now backed up. For the latest information about performing backups, see PostgreSQL database backups.
What to do next
After backing up your data, the next step in the upgrade process is to update your SaltStack Config databases. See Upgrade databases for more information.