SynologyLogo

Synology – Moving a package between volumes

I have a Synology 8-bay NAS used for home-lab purposes, but also doubles as local home storage as well.

As part of upgrades, I was decommissioning a volume for a new one with higher capacity drives, however I had Plex installed on the volume to be decommissioned. I moved all the data using the internal file manager, but the package installation remained in place.

Migrate package to another volume

  1. Stop your application via the Synology package center UI.
  2. Login to Synology using SSH and elevate to root.
  3. Use “ls” against /VolumeX/@appstore to find your package folder name
  4. Use “mv” to move the data between the old and new volume, you may need to create the @appstore folder first.
  5. Remove the symlink from the current volume and create the new symlink to the new volume.
  6. Stop and start your package in the Synology Package Centre.

Below is an example the commands I used;

sudo mkdir /volume2/@appstore
sudo mv "/volume1/@appstore/Plex Media Server" "/volume2/@appstore"
sudo rm "/var/packages/Plex Media Server/target"
sudo ln -s "/volume2/@appstore/Plex Media Server" "/var/packages/Plex Media Server/target"

synology migrate package to new volume veducate.co .uk

Now when you try to remove the volume, your package will now show as attached to the volume.

synology remove volume1synology remove volume2

Regards

Dean

22 thoughts on “Synology – Moving a package between volumes

  1. Thank you for the clear instructions! I think I speak for allot of people when I say that this has come in handy on more than one occation.

  2. I am not sure if that is specific to DSM 7 or the package I was moving (MariaDB), but I had to move a bunch of other folders as well:

    mv /volume1/@appstore/MariaDB10 /volume2/@appstore
    mv /volume1/@appconf/MariaDB10/ /volume2/@appconf
    mv /volume1/@apphome/MariaDB10/ /volume2/@apphome
    mv /volume1/@apptemp/MariaDB10/ /volume2/@apptemp
    mv /volume1/@appdata/MariaDB10/ /volume2/@appdata

    rm /var/packages/MariaDB10/target
    rm /var/packages/MariaDB10/etc
    rm /var/packages/MariaDB10/home
    rm /var/packages/MariaDB10/tmp
    rm /var/packages/MariaDB10/var

    ln -s /volume2/@appstore/MariaDB10 /var/packages/MariaDB10/target
    ln -s /volume2/@appconf/MariaDB10 /var/packages/MariaDB10/etc
    ln -s /volume2/@apphome/MariaDB10 /var/packages/MariaDB10/home
    ln -s /volume2/@apptemp/MariaDB10 /var/packages/MariaDB10/tmp
    ln -s /volume2/@appdata/MariaDB10 /var/packages/MariaDB10/var

  3. be aware that some packages store their data in the same volume under @packagename

    the volume where that lives is referenced in (eg for CloudSync) /usr/syno/etc/packages/CloudSync/setting.conf so if that does exist then you need to move that directory as well, and then update that config file to point to the new volume.

    not all packages have something like this, but people need to double check before they remove the volume thinking its no longer being used.

  4. You don’t need to recreate the links manually.

    After you move the folders (all @app*, @ and some other such as @database or @download) you just open the Package Center in DSM, select Installed and click Fix all.
    DSM will re-download and re-install all moved packages and, as a part of the fix process, will search all volumes and move the package to the disk where its files are located.

    After fix, you can open each package and check if its data were moved correctly.

    1. Hi thanks for this, I didn’t see that option in my setup, there was no “Fix all” option, it was a long time ago, but I think it showed an error or unavailable. But this would have been an older version of DSM.

  5. If someone thinking about moving some packages to system partition:
    Packages on system partition are here:
    /usr/local/packages/@appstore

    In theory (and if enough free space) one could move some packages there and no need to worry about deleting/moving volumes.

    1. Not sure if moving things to the system partition is the best idea, especially if the package starts filling it up and runs it out of space. But I’ll leave the comment here incase anyone is feeling brave. Thanks Tom!

  6. Thanks. Worked perfectly on my Xpenoly/Syno DSM6.2 system. In my case the volume crashed and went into Read-only mode. So I could copy my shared folders out to different volume but could not run ‘mv’ has to run ‘cp -R’ instead. Just a note for someone on the same boat.

  7. Based on the article and comments, I create this script:

    #! /bin/bash
    set -eu

    for app in AudioStation DownloadStation
    do
    echo “Migrating $app”
    mv “/volume1/@appstore/$app” “/volume2/@appstore”
    mv “/volume1/@appconf/$app” /volume2/@appconf
    mv “/volume1/@apphome/$app” /volume2/@apphome
    mv “/volume1/@apptemp/$app” /volume2/@apptemp
    mv “/volume1/@appdata/$app” /volume2/@appdata

    rm /var/packages/$app/target
    rm /var/packages/$app/etc
    rm /var/packages/$app/home
    rm /var/packages/$app/tmp
    rm /var/packages/$app/var
    rm /usr/syno/etc/packages/$app

    ln -s /volume2/@appstore/$app /var/packages/$app/target
    ln -s /volume2/@appconf/$app /var/packages/$app/etc
    ln -s /volume2/@apphome/$app /var/packages/$app/home
    ln -s /volume2/@apptemp/$app /var/packages/$app/tmp
    ln -s /volume2/@appdata/$app /var/packages/$app/var
    ln -s /volume2/@appconf/$app /usr/syno/etc/packages/$app

    done

    1. Thanks for sharing, for anyone looking to use this script, it will work for the apps configured on line 4 of the script, you may need to update this with your other applications installed.

    2. Thank you for this! I started off with this approach and later learned that some apps rely on other folders that also need to be migrated.

      This project / script takes those into consideration:
      https://github.com/007revad/Synology_app_mover/tree/main

      For scanning for symlinks that might remain pointing at the old volume I recommend running this command:
      find . -name “*” -type l -exec ls -ld ‘{}’ \; | grep volume1

  8. If you are moving Synology Drive it appears you need to move the synology drives database from with in the Drive admin console before moving any files for the application from one volume to another.

  9. I used a script to do the symlink moving
    SRC_DIR=”/var/packages/”
    OLD_TARGET=”/volume1/@appstore”
    SUB=”s/volume1/volume2/”
    find $SRC_DIR -type l \
    -lname “$OLD_TARGET/*” -printf \
    ‘ln -nsf “$(readlink “%p”|sed $SUB)” “$(echo “%p”|sed $SUB)”\n’\
    > script.sh

    you can then just run the created script.sh or test a few lines first.
    I just pasted the resulting lines in the terminal afterwards.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.