007revad / Synology_app_mover

Easily move Synology packages from 1 volume to another volume
MIT License
376 stars 26 forks source link

Does not move pgsql database to new volume #114

Closed RobinEd closed 1 day ago

RobinEd commented 1 month ago

Hi, I am trying to move everything from volume1 to volume2 - thanks a lot for your efforts to get that done! However, you do not offer the option to move /volume1/@database to /volume2/ When I removed the volume1 disks, my photos data was gone :) Luckily I had only physically removed them, not destroyed the volume (yet). So please can you also offer this option to your excellent script? Thanks in advance!

007revad commented 1 month ago

You're only the 2nd person to ask about this. Moving the @database folder makes sense if if the original volume is going to be deleted. For all other cases it's better to leave @database where is it is.

It's better to move /volume1/@database/pgsql to volume2

You can move the pgsql database with:

  1. Stop the pgsql service: sudo systemctl stop pgsql-adapter.service

  2. Then create the folder: sudo mkdir /volume2/@database/pgsql

  3. Move with: sudo mv /volume1/@database/pgsql /volume2/@database/pgsql

  4. Change the rights: sudo chown postgres.postgres /volume2/@database/pgsql

  5. Change the pgsql symlink:

    sudo rm /var/services/pgsql
    sudo ln -s /volume2/@database/pgsql /var/services/pgsql
  6. Start the pgsql service: sudo systemctl start pgsql-adapter.service

  7. Check if pgsql is ok: sudo systemctl status pgsql-adapter.service

If you were using a shared space in photos and have moved the shared space to volume2 you may then need to:

  1. Go to Synology Photos > Settings > Shared Space.
  2. Disable the Shared Space.
  3. Then go back in and Enable Shared Space.
RobinEd commented 1 month ago

Thank you for your answer, I had done something like this except the shared space bit :) My use case is exactly that - I upgraded from a 2 bay model to a 5 bay model. The 2 bay model had a RAID1 array and I bought 2 drives for the new one which I set up as SHR. I then discovered I could not convert RAID1 -> SHR and combine the volume, so I needed to move everything from volume1 and then delete it.

007revad commented 1 month ago

I've written myself a test script that checks all installed packages to see if any depend on pgsql and if any do they are added to a list.

007revad commented 1 day ago

v4.2.75