I upgraded my Raspberry Pi from Wheezy to Stretch this morning and I’m having issues restoring Seafile from backups. Hopefully someone can help me figure out what I’m doing wrong!
I followed this guide for both backing up and restoring Seafile, however, when I attempt to login on the web I get a page that says:
Page unavailable
Sorry, but the requested page is unavailable due to a server hiccup.
Our engineers have been notified, so check back later.
Attempting to login with any dedicated client results in Failed to login: Internal Server Error.
Here’s the backup script I had been using (with credentials redacted):
FILE_NAME="$(date '+%Y_%m_%d')"
LOG_PATH=/home/alex/logs/seafile/$FILE_NAME.log
DIR_PATH=/mnt/data/Backups/Seafile
FOLDER_PATH=$DIR_PATH/$FILE_NAME
echo "--------------------------------------------" >> $LOG_PATH
echo "[$(date '+%Y %b %d %H:%M:%S')] Running Seafile backup" | tee -a $LOG_PATH
echo "[$(date '+%Y %b %d %H:%M:%S')] Deleting old backups..." | tee -a $LOG_PATH
find $DIR_PATH/* -prune -type d -mtime +7 -print -exec rm -rf {} \; >> $LOG_PATH
echo "[$(date '+%Y %b %d %H:%M:%S')] Stopping seafile..." | tee -a $LOG_PATH
/opt/seafile/seafile-server-latest/seafile.sh stop
/opt/seafile/seafile-server-latest/seahub.sh stop
echo "[$(date '+%Y %b %d %H:%M:%S')] Collecting garbage..." | tee -a $LOG_PATH
/opt/seafile/seafile-server-latest/seaf-gc.sh
echo "[$(date '+%Y %b %d %H:%M:%S')] Creating backup folder..." | tee -a $LOG_PATH
mkdir $FOLDER_PATH
echo "[$(date '+%Y %b %d %H:%M:%S')] Databases..." | tee -a $LOG_PATH
mysqldump -h localhost -uUSERNAME_REDACTED -pPASSWORD_REDACTED --opt ccnet-db > $FOLDER_PATH/ccnet-db.sql
mysqldump -h localhost -uUSERNAME_REDACTED -pPASSWORD_REDACTED --opt seafile-db > $FOLDER_PATH/seafile-db.sql
mysqldump -h localhost -uUSERNAME_REDACTED -pPASSWORD_REDACTED --opt seahub-db > $FOLDER_PATH/seahub-db.sql
echo "[$(date '+%Y %b %d %H:%M:%S')] Data..." | tee -a $LOG_PATH
rsync -azv --progress /mnt/data/seafile/ $FOLDER_PATH | tee -a $LOG_PATH
touch $FOLDER_PATH #fixes wrong timestamp issue
echo "[$(date '+%Y %b %d %H:%M:%S')] Starting seafile..." | tee -a $LOG_PATH
/opt/seafile/seafile-server-latest/seafile.sh start
/opt/seafile/seafile-server-latest/seahub.sh start
echo "[$(date '+%Y %b %d %H:%M:%S')] Backup Complete!" | tee -a $LOG_PATH
The documentation was not super clear on steps for restoring backups - I had to combine the guide I linked above with some results from google searches. Here are the steps I ended up following:
- Created a new user called Seafile
- Downloaded 6.2.2 for RPI
- Unzipped the archive in the home directory and moved the archive into a new folder called installed
- Ran setup-seafile-mysql.sh
- Followed the prompts using information from my previous installation (admin and mysql accounts)
- Logged logged into the admin account to verify seafile was working
- Stopped seafile via seahub.sh stop and seafile.sh stop
- Ran mysql -uUSERNAME -pPASSWORD ccnet-db < ccnet-db.sql for ccnet-db, seafile-db, and seahub-db.
- Retarted seafile seahub.sh start and seafile.sh start
EDIT: It just dawned on me that I may not have downloaded the same version I was on previously. Is there a way to check what version I was using?