Nextcloud snap migration guide?

Hello everybody

I am about to move my Nextcloud (snap) installation from a Raspberry PI running Raspian (armv7l, based on Debian 9.9) to a Nano Pi M4 running Armbian (aarch64, based on Debian 9.9 but 64 bits and older kernel). The snap version numbers are identical on source and target.

I have read the maintenance chapter in the Admin manual (backup, restore, migrate) but they are not specifically written for the snap version, and I didn’t find something more specific for my case. I am a seasoned Linux guy so the questions are really related to Nextcloud and MySql, and more specifically to the snap version.

I have written down the specific steps, but I still have a few questions:

  1. is moving from 32 bits to 64 bits even possible? or should I rather run both instances in // and migrate the files on one client (it’s possible because I mainly use the Files app, but I’d prefer a real migration)
  2. is there anything specific to update since I am going from 32 to 64 bits?
  3. do I have to start the target instance once in order to create the SQL tables, or would it be better to start it only after the migration?
  4. how can I find out if I need to recreate the database with the “CHARACTER SET” option? “status” command in mysql client says “db characterset latin1” so I assume it’s a NO
  5. why is there no “use nextcloud” in the beginning of the sql dump? is it implicit with creation?
  6. should I “occ files:scan” after migration to be sure?

Any help is appreciated!

1 Like

I have the same question. Nextcloud official should write a guidance for the snap version.

I used snap’s snapshot feature to migrate to a new machine.

On the old server:

  1. Enable maintenance mode
sudo nextcloud.occ maintenance:mode --on
  1. Disable nextcloud-snap
sudo snap disable nextcloud
  1. Create snapshot. This will create a .zip file in /var/lib/snapd/snapshots/. In my case its name was
sudo snap save nextcloud

Now transfer the file to the new server using rsync or an usb drive and place it in /var/lib/snapd/snapshots/.

On the new server:

  1. Install nextcloud-snap
sudo snap install nextcloud
  1. Restore snapshot. Replace <n> with the first number of the .zip file, in my case 4.
sudo snap restore <n>
  1. Disable maintenance mode
sudo nextcloud.occ maintenance:mode --off
  1. Make sure everything is working fine

thanks for this method. i started down this route, but am concerned about the size of the snapshot.

is there a way to specify where to save the nextcloud snapshot (to point to a mounted file location, for example)? i didn’t see it in the help menu for snap save

Sorry, I never read your question.
I don’t know about an official way to change the snapshot location, but I think it should be possible to mount an external drive to /var/lib/snapd/snapshots/.