Administration
...
Updating Passwork components
MongoDB
Debian
14min
if a replication suite is used, please contact passwork technical support to update and save data correctly if passwork is installed on a virtual server, we recommend creating a snapshot before updating this page uses switchable code blocks to provide instructions for different operating systems creating a backup create a directory shell mkdir /backup create a backup shell mongodump out /backup/mongo $(date +\\%y \\%m \\%d \\%h \\%m \\%s) removing the older version stop the service shell systemctl stop mongod service move the configuration file shell mv /etc/mongod conf / remove the database with configuration files shell apt purge mongodb org y delete directory with log files shell rm r /var/log/mongodb delete mongodb data files shell rm r /var/lib/mongodb remove deprecated repository for mongodb 4 x shell rm f /etc/yum repos d/mongodb org 4 x repo update the list of available packages shell apt get update installing mondodb download and add the mongodb gpg key debian 11 wget qo https //www mongodb org/static/pgp/server 6 0 asc | sudo apt key add debian 12 curl fssl https //www mongodb org/static/pgp/server 7 0 asc | gpg o /usr/share/keyrings/mongodb server 7 0 gpg dearmor add mongodb repository to the file debian 11 echo "deb http //repo mongodb org/apt/debian buster/mongodb org/6 0 main" | sudo tee /etc/apt/sources list d/mongodb org 6 0 list debian 12 echo "deb \[ signed by=/usr/share/keyrings/mongodb server 7 0 gpg ] http //repo mongodb org/apt/debian bookworm/mongodb org/7 0 main" | tee /etc/apt/sources list d/mongodb org 7 0 list update the list of available packages shell apt get update install the database and administration utilities shell apt get install y mongodb org start the mongod service shell systemctl start mongod service enable autostart of the service shell systemctl enable mongod service perform a shell connection check shell mongosh mongodb //localhost 27017 restoring the backup if the connection to the shell is up, restore the databases from the backup shell mongorestore drop /backup/mongo xxxx xx xx xx xx xx if any parameter changes were made to the mongodb configuration file ( mongod conf ), you must replace the new file with the old one shell cp /mongod conf /etc/ restart the mongod service shell systemctl restart mongod service and open passwork to verify that everything was done correctly