cryptpad/README.copy-userdata-to-new-installation
2023-12-12 16:28:41 +01:00

50 lines
777 B
Plaintext

# =================
# Copy existing user data to new pad
# =================
cryptpad_user=cryptpad
# Stop cryptpad service
#
systemctl stop cryptpad.service
# login as cryptpad user
#
su - ${cryptpad_user}
backup_date="2023-12-12-1442"
# Backup current installation
#
cp -a cryptpad cryptpad.CURRENT
# Copy configuration file
#
cp cryptpad.BAK.${backup_date}/config/config.js cryptpad/config/config.js
for i in blob blobstage block datastore ; do
echo""
echo -e " Syncing directory '${i}'.."
rsync -a --delete /var/www/cryptpad/cryptpad.BAK.${backup_date}/$i /var/www/cryptpad/cryptpad/
chown cryptpad:cryptpad /var/www/cryptpad/cryptpad/$i
done
# logoff from cryptpad user
#
exit
# Start cryptpad service
#
systemctl start cryptpad.service