cryptpad/README.copy-userdata-to-new-installation
2024-01-06 14:21:36 +01:00

61 lines
1.0 KiB
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
# Instanzkonfiguration
#
# Note:
# some settings cannot be changed once user accounts have been created.
#
cp cryptpad.BAK.${backup_date}/customize/application_config.js cryptpad/customize/application_config.js
# Copy user data
#
#for i in blob blobstage block datastore ; do
for i in data datastore block blob ; 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