Moving database directory to a new partition, Ubuntu20.04

I am running Stardog7.6.4 on a Ubuntu 20.04 machine. The binaries are located in /opt/stardog/bin and STARDOG_HOME is set to /var/opt/stardog.
I am out of space on that partition, so I want to move my databases to another partition, but keep the binaries where they are. Am I correct that this would be the way to proceed?

  1. export all databases
  2. shut down the server
  3. Create a directory on the other partition /data/stardog
  4. Copy the license key to /data/stardog
  5. Change /etc/ to contain
    export STARDOG_HOME=/data.stardog
  6. Restart the server
  7. import the databases

Do I need any other steps?
And if something goes wrong, can I simply back out by changing STARDOG_HOME back to /var/opt/stardog? If I don't change anything in that folder, I assume the server would be able to access the original databases?

Thanks. I really need to move to the new partition but I don't want to lose my databases!

It looks good just a couple of suggestions. You can do a server backup / server restore rather than an export to make sure you capture everything. You can also simply copy the directory contents to the new location and update STARDOG_HOME, but would still recommend a backup.

You might want to verify the new location with Stardog-admin server status. I can see getting things pointing to somewhere other than where you though they were and then if you write to the wrong place things start getting complicated.

Thanks. I didn't think it was possible to simply copy the databases over - I had tried to do something like that once and got error messages. I certainly will do the backups in any case.

It should be ok as long as you shutdown the server first and take care to preserve the permissions like using the -p flag if using cp. Someone also suggested that you can use rsync as well.