Transitioning from plain installation to containerized (eg snap)

I am running Nextcloud (currently 30.0) on an Ubuntu 24.04 LTS home server, for personal purposes (family calendars, documents, photos, etc). I installed it years ago, and kept upgrading it, it is working fine, but every once in a while I have to manually intervene on upgrades.

I am wondering

  1. if it would make sense to run in a container, which would allow more robust updates, possibly unattended,
  2. which container I should choose (I am leaning towards snap, as I am on Ubuntu),
  3. how one would migrate the data (I have a MariaDB setup), is there a tutorial on this?

I can find my way around the command line, but I am just a home user, not a system administrator.

hey @tpapp welcome back

I believe the snap would fulfil your requirements quite nicely. do some research and you’ll find it will suit your needs see:

Nextcloud snap is designed to be easy to install and simple to maintain. The ideal Nextcloud snap is an “install and forget” Nextcloud instance that works on most architectures and updates itself without needing administrative skills. Combining Nextcloud with Snapd makes it a perfect fit for IoT or scalable environments. Snapd is a secure and robust technology which the Nextcloud snap team has embraced. Most importantly snaps are designed to be secure, sandboxed, containerized applications isolated from the underlying system and from other applications.

since the snap is basically a container (see confinement) , there is certainly no need to further containerise the snap… although its possible, see my setup here SCUBA’s Nextcloud snap server setup & specs

migrating your database will require some database knowledge and linux command line experience. it may be simpler to copy the raw data from the existing instance to your new instance instead. can you mention data in the database that could not be transferred manually?

1 Like

thanks for your quick answer @scubamuc!

TBH I know very little about migrating databases, I don’t think that there is anything special going on with Nextcloud but I thought I would better check.

I am using MariaDB and the snap uses MySQL, and reading some tutorials suggests that I can just do a dump and a load. Is that correct?

@tpapp, I’m no database expert either, but as I unserstand it, MariaDB is a fork of MaSQL and a dump should do it.

have a look at those requirements if you can make a mark… you’re a for away.

the only things I can think of that you’d need to extract from your current database:

  • addressbooks and calendars (export in ui from old instance and import in new instance)
  • useraccounts, depending on how many users, prefer re-creating them on the new instance

I would suggest running both instances parallel and transferring that data manually. Later you can transfer the raw data (documents, fotos) in raw format or re-uploading manually… that’ll give you the opportunity to tidy up too :+1:

1 Like

I would recommend starting with official server migration docs. if you need more recommendations review existing topics tagged server_migration

I would not recommend such approach as this results in loosing all “cloud” functions created in the old instance - file versions and trash, file comments, shares, contacts and calendars (and most apps data)..

for snap I can’t tell but for “community” Docker image you could simply restore the DB dump and move the data of native install into right locations (bind mounts) as easy migrations step. pretty complete and advanced guide you find in Problems with How to docker-compose with notify_push (2024)

for each method I would recommend you do some tests major maintenance tasks (backup, restore, upgrade) before you completely switch to another platform.

1 Like