Synology_app_mover
Synology_app_mover copied to clipboard
After moving @database, synologan still keeps @database/synologan in the original volume
I've noticed that after moving @database, synologan still insist on keeping it's database at /volume1/@database/synologan.
It seems that it's because it's symlinked in /var/lib/synologan/database/
ash-4.4# ls -lh /var/lib/synologan/database/
total 0
lrwxrwxrwx 1 root root 41 Dec 26 2022 alert.sqlite -> /volume1/@database/synologan/alert.sqlite
As a workaround currently, for anyone searching for this, I've run the following
sudo systemctl stop synologand
cd /var/lib/synologan/database/
rm alert.sqlite
ln -s /volume2/\@database/synologan/alert.sqlite .
sudo systemctl start synologand
So far it's working
Thanks @rsemau
I'll incorporate into the function that moves @database.
It doesn't seem to work for me. When I run it like this, I see this after start of synologand:
/var/lib/synologan/database# ls -laF
lrwxrwxrwx 1 root root 41 Oct 9 20:32 alert.sqlite -> '/volume1/@database/synologan/alert.sqlite'
But the app mover script says: 3) /volume11 @database
volume11 is a m.2 volume here (created with hdd script) and there is no alert.sqlite on volume11:
ls '/volume11/@database/synologan/alert.sqlite'
ls: cannot access '/volume11/@database/synologan/alert.sqlite': No such file or directory
@rsemau I completely forgot about this, until now.
@MAngel666 This should return "alert.sqlite":
ls '/volume1/@database/synologan'
Then to fix the symlink:
sudo systemctl stop synologand
rm /var/lib/synologan/database/alert.sqlite
ln -s "/volume11/@database/synologan/alert.sqlite" /var/lib/synologan/database/alert.sqlite
systemctl start synologand
done:
ls '/volume1/@database/synologan'
alert.sqlite
sudo systemctl stop synologand
rm /var/lib/synologan/database/alert.sqlite
ln -s "/volume11/@database/synologan/alert.sqlite" /var/lib/synologan/database/alert.sqlite
systemctl start synologand
ls -laF /var/lib/synologan/database/alert.sqlite
lrwxrwxrwx 1 root root 41 Oct 10 11:40 /var/lib/synologan/database/alert.sqlite -> '/volume1/@database/synologan/alert.sqlite'
and:
ls "/volume11/@database/synologan/alert.sqlite"
ls: cannot access '/volume11/@database/synologan/alert.sqlite': No such file or directory
there is no file for the symlink
Try this:
sudo systemctl stop synologand
cp -pr "/volume1/@database/synologan" "/volume11/@database/synologan"
systemctl start synologand
ok this worked:
systemctl stop synologand
cp -pr "/volume1/@database/synologan" "/volume11/@database/synologan"
ln -s "/volume11/@database/synologan/alert.sqlite" /var/lib/synologan/database/alert.sqlite
systemctl start synologand
ls -laF /var/lib/synologan/database/alert.sqlite
lrwxrwxrwx 1 root root 42 Oct 14 20:47 /var/lib/synologan/database/alert.sqlite -> '/volume11/@database/synologan/alert.sqlite'
With the new version of the script, moving the database worked without any problems.