Migrate from standalone NextcloudPi to Yunohost server

:us: English

My YunoHost server

Hardware: Old laptop or computer
YunoHost version: 11.0.10.2
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Hello, I have a PC server running a PC version of NextcloudPi. The architecture is as follows:

  • 1 SSD on which runs an image of NextcloudPi
  • 1 HDD of 8TB filled to more than half and on which the data of the Nextcloud user accounts are stored (on /media/Data)

Lately, NextcloudPi has some problems (port 80 and 443 closed when they are actually open, or connection problems via MacOS, etc.). By searching carefully, I understood that the PC version of NexcloudPi was not maintained for a long time (only ARM are).
Being satisfied with Yunohost on my other server, I would like to replace the NextcloudPi on my SSD with a Yunohost OS + the Nextcloud application.

How do I replace the OS on the SSD without having to migrate the ~5TB of data? Thanks!


:fr: Français

Mon serveur YunoHost

Matériel: Vieil ordinateur
Version de YunoHost: 11.0.10.2
J’ai accès à mon serveur : En SSH | Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non

Description du problème

Bonjour, j’ai un serveur PC sur lequel tourne une version PC de NextcloudPi. L’architecture est la suivante :

  • 1 SSD sur lequel tourne une image de NextcloudPi
  • 1 HDD de 8TB rempli Ă  plus de la moitiĂ© et sur lequel les donnĂ©es des comptes utilisateurs Nextcloud sont stockĂ©es (sur /media/Data)

Ces derniers temps, NextcloudPi a des soucis (port 80 et 443 fermés alors qu’ils sont en réalité ouverts, ou bien des soucis de connexion via MacOS, etc.). En cherchant bien, j’ai compris que la version PC de NexcloudPi n’était plus maintenue depuis un bon moment (seuls les ARM le sont).
Etant satisfait de Yunohost sur mon autre serveur, j’aimerais remplacer le NextcloudPi de mon SSD par un Yunohost + l’application Nextcloud.

Comment faire pour remplacer l’OS sur le SSD sans avoir à migrer les ~5TB de données ? Merci !

What I would do (untested, on loosely based on the Nextcloud documentation):

  1. Export your database: mysqldump --single-transaction -h localhost -u [username] -p [password] [db_name] > /media/Data/nextcloud-sqlbkp.bak
  2. Make an image of your SSD, and store it safely on the HDD for example. Who knows what might go wrong…
  3. If you use /etc/fstab to mount your HDD, save the line corresponding to its mountpoint.
  4. Install YunoHost on the SSD.
  5. Perform the postinstall, make sure your admin username is the same as the one on the Nextcloud instance and re-create the standard Nextcloud users with the same usernames (easier for keeping permissions the same)
  6. Mount your HDD:
    • Restore the line in /etc/fstab, recreate the mountpoint with sudo mkdir /media/Data then sudo mount /media/Data, or follow any Debian tutorial.
  7. Install the Nextcloud app.
  8. Follow the instructions there Nextcloud | Yunohost Documentation, starting with the nano /var/www/nextcloud/config/config.php command to tweak datadirectory. The idea is to put the path of the data directory on your HDD. For example this is what the directory looks like on my instance:
ls /home/yunohost.app/nextcloud/data
appdata_SomeString  index.html     user1
files_external        nextcloud.log  user2
  1. Restore the database: mysql -B nextcloud < /media/Data/nextcloud-sqlbkp.bak
  2. Hope for the best. :slight_smile:
1 Like

Hello and thank you very much for your kind help. When you say the above, do you mean the Yunohost admin username shall match the Nextcloud admin username, did I understood well ? Thank you

1 Like

Yes! It could work without that, but it’s simpler like that.

1 Like

Thank you ! Last but not least, there is a GUI panel to make backups, can I use it instead of command line (because I am not familiar with SQL and I don’t know exactly what [db_name] correspond to) ? :

Thank you again

I guess so, yes. Though keep the “Include data” unchecked. :wink:
Put the file in the /media/Data directory.

I have no idea how you can restore it afterwards though.

If you need to provide its path, after installation of Nextcloud, make sure it has access to it with sudo chown nextcloud:nextcloud /media/Data/THE_FILE.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.