Export data from bare metal and import to a snap install?

short answer: “no”

raw data could be copied:

  • add users in snap and then copy raw data from bare metal to snap data directory →
    /var/snap/nextcloud/common/nextcloud/data/$USER
    • then scan all files sudo nextcloud.occ files:scan --all

but database will be very difficult and not recommended
no guarantees though, never tried this before… and it probably won’t work!

  • export mysql database from bare metal install and import into snap →
    sudo nextcloud.import -b but you’d lose all path references!
    you will have to rescan:
    • sudo nextcloud.occ files:repair-tree
    • sudo nextcloud.occ files:scan --all
    • sudo nextcloud.occ files:scan-app-data

recommend running both instances in parallel and then rclone the data from one instance to the other.