These instructions are for basic .deb-based deployments, adapt as necessary for custom ones.
- Stop the server,
systemctl stop clapshot-server - Install the new packages:
dpkg -i clapshot-*.deb - Compare your current configuration (
/etc/clapshot-server.conf) to the latest example at/usr/share/doc/clapshot-server/examples/clapshot-server.conf. Edit as necessary. - Make sure
migration = truein the config file. - Start the server,
systemctl start clapshot-server - Check that it started,
systemctl status clapshot-server - Review server log at
/var/log/clapshot.log. If the server or organizer applied any database migrations, they are mentioned in the log, and a backup.tar.gzwill be present next to your database (usually,/mnt/clapshot-data/data/clapshot.sqlite). - If the server didn't start properly, set
debug = truein/etc/clapshot-server.conf, and start again. This will increase log verbosity level, to give you more clues on what went wrong.
- Make sure to fully reload the Client page in a browser if Client package was upgraded. You might otherwise see unexpected behavior.
- The basic_folders Organizer plugin doesn't have its own systemd entry (it's executed by the Server), so you don't need to
systemctl stop/startit. It also piggybacks the server when doing migrations.
If you find this migration guide lacking, please contribute corrections and additions on the Clapshot's GitHub page.
The database migration script on release 0.6.0 had a bug that would lose existing comments. Here's the procedure to restore them, in case you got burnt by this before the broken release was pulled:
cd /mnt/clapshot-data/(or where ever yourclapshot.sqliteis)- Check if the DB has any comments:
sqlite3 clapshot.sqlite "select count(*) from comments;"(if this returns "0" but you previously had comments, continue to the next step to restore them.) - Locate the latest sqlite backup:
ls clapshot.backup-*. Clapshot server makes backups automatically before all migrations. It should look something like:clapshot.backup-2024-05-20T12_34_56.tar.gz - Unpack the backup to a temp dir:
mkdir db-restore-temp && cd db-restore-temp && tar xvfz ../clapshot.backup-2024-05-20T12_34_56.tar.gz(replace the .tar.gz with the latest you have) - Dump comments from the backup into a text file:
sqlite3 ./clapshot.sqlite ".dump --data-only comments" > comments-restore.sql - Check that the comments are there:
less comments-restore.sql - Insert them back to current DB:
sqlite3 ../clapshot.sqlite ".read ./comments-restore.sql" - Verify:
sqlite3 ../clapshot.sqlite "select count(*) from comments;"(this should now return the correct number of comments)
You can now remove the temp directory db-restore-temp, no need to restart the server.