Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #22313: Problem in Server backup and migration documentation #970

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/reference/modules/administration/pages/procedures.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ cd /tmp/backup
# Second, the PostgreSQL database:
sudo -u postgres pg_dump -Fc rudder > rudder-backup-$(date +%Y%m%d).sql

# Or without sudo, use the rudder application password:
pg_dump -Fc -U rudder rudder > rudder-backup-$(date +%Y%m%d).sql

# Third, backup the configuration repository:
tar -C /var/rudder -zcf rudder-backup-$(date +%Y%m%d).tar.gz configuration-repository/ cfengine-community/ppkeys/

Expand Down Expand Up @@ -182,7 +179,7 @@ Here is the restoration procedure:
rudder agent disable

# Stop Rudder services
systemctl stop rudder-agent rudder-server
systemctl stop rudder-agent rudder-server rudder-relayd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rudder-server is an umbrella service that should include rudder-relayd.

If we don't want to use it it should be rudder-jetty instead.


# Drop the OpenLDAP database
rm -rf /var/rudder/ldap/openldap-data/*.mdb
Expand All @@ -205,13 +202,12 @@ tar -C /var/rudder -zxf rudder-backup-plugin-resources-XXXXXXXX.tar.gz
# Change ownership of files to rudder-slapd
chown -R rudder-slapd:rudder-slapd /var/rudder/ldap/openldap-data

# Start PostgreSQL
systemctl start postgresql
# Restart PostgreSQL to ensure that no connection remains
systemctl restart postgresql

# PostgreSQL backup
sudo -u postgres pg_restore -d rudder --clean --create < rudder-backup-XXXXXXXX.sql
# or
pg_restore --username rudder -d rudder --clean --create -W < rudder-backup-XXXXXXXX.sql
# PostgreSQL restore
sudo -u postgres dropdb -U postgres rudder
sudo -u postgres pg_restore -d postgres --clean --create < rudder-backup-XXXXXXXX.sql

# Configuration backup
tar -C /opt/rudder -zxf rudder-etc-backup-XXXXXXXX.tar.gz
Expand Down