# Yunohost migration

**URL:** <https://forum.yunohost.org/t/yunohost-migration/1250>\
**Category:** Tutorials\
**Tags:** obsolete, french\
**Created:** [January 27, 2016, 10:53pm UTC](https://forum.yunohost.org/t/yunohost-migration/1250 "2016-01-27T22:53:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bachy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bachy/32/30_2.png) [@Bachy](https://forum.yunohost.org/u/Bachy)\
**Post date:** [January 27, 2016, 10:53pm UTC](https://forum.yunohost.org/t/yunohost-migration/1250/1 "2016-01-27T22:53:14Z")

</div>

# EDIT from ljf: Since this tuto a lot of apps have received a backup/restore script, so you can simply use the `yunohost backup create` and `yunohost backup restore` feature

I (almost) accidentatly ruined my YNH server yesterday by trying an upgrade from Wheezy to Jessie. (don’t do that)  
It was a dedicated server hosted by ovh, and it was so messy that at the end i couldn’t even connect through ssh … my only access was by rebooting in rescu mode, so i had access to my files but YNH was not running anymore, snif.  
So i started what i should have done from the beginning : migrating my server (and all his data : 10 users, arround 10 apps) to an other server (with Jessie on it).  
Here is all the details of what to do in such a case.

# backups

Fortunatly i had a fresh backup of two important things :

- the ldap base (thanks to josue see [Debian 8.0 Jessie compatibility](https://forum.yunohost.org/t/debian-8-0-jessie-compatibility/601/14?u=bachy))
- and a dump of each mysql dbs.  
**Every YNH maintainers should have this tow things backuped.**

every thing is ran as root, you may need to add sudo in front of commands

# install YNH

Install Yunohost as usual on your new server  
[https://yunohost.org/#/install\_manually\_fr](https://yunohost.org/#/install_manually_fr)

# post install

run the yunohost configuration as usual with the very same domain.tld as your previous server but do not create the users  
[https://yunohost.org/#/postinstall\_fr](https://yunohost.org/#/postinstall_fr)

# certificats migration

on your new server, backup your certificats

```auto
$ mv /etc/yunohost/certs/yourdomain.tld /root/yourdomain.tdl.back

```

get back your certs, run from your old server

```auto
$ rsync -av /etc/yunohost/certs/yourdomain.tld root@yo.ur.new.ip:/etc/yunohost/certs/

```

again on your new server

```auto
$ service nginx reload

```

see [https://yunohost.org/#/certificate\_fr](https://yunohost.org/#/certificate_fr)

# get back your users

fortunatly i previously made an ldap backup  
see this post : [Debian 8.0 Jessie compatibility](https://forum.yunohost.org/t/debian-8-0-jessie-compatibility/601/14?u=bachy)  
so i could restore it

```auto
# backup
$ slapcat -v -l /chemin_vers_ma_sauvegarde/nom_de_ma_sauvegarde.ldif

# restore
$ service slapd stop
$ mv /var/lib/ldap /var/lib/ldap.old
$ mkdir /var/lib/ldap
$ chown openldap:openldap /var/lib/ldap
$ chmod go-rwx /var/lib/ldap
$ slapadd -v -l /chemin_vers_ma_sauvegarde/nom_de_ma_sauvegarde.ldif
$ chown openldap:openldap /var/lib/ldap/data.mdb
$ chown openldap:openldap /var/lib/ldap/lock.mdb
$ service slapd start

```

# migrate your emails

## if the old mail server is still running

[https://yunohost.org/#/email\_migration\_fr](https://yunohost.org/#/email_migration_fr)

## if not (like mine)

from the old server

```auto
$ rsync -av /var/mail/ root@yo.ur.new.ip:/var/mail/

```

be carrefull with trailing slashes (see man rsync)

# Apps

## roundcube

from the new server  
install the app from ynh admin  
then import de bdd

```auto
$ mysqldump -u root -p roundcube > roundcube.sql
$ mysql -u root -p
mysql> drop database roundcube;
mysql> create database roundcube;
mysql> exit
$ mysql -u root -p roundcube < roundcube-old.sql

```

## baikal

from the new server  
install the app from ynh admin  
then import de bdd

```auto
$ mysqldump -u root -p baikal > baikal.sql
$ mysql -u root -p
mysql> drop database baikal;
mysql> create database baikal;
mysql> exit
$ mysql -u root -p baikal < baikal-old.sql

```

## agendav

from the new server  
install the app from ynh admin  
then import de bdd

```auto
$ mysqldump -u root -p agendav > agendav.sql
$ mysql -u root -p
mysql> drop database agendav;
mysql> create database agendav;
mysql> exit
$ mysql -u root -p agendav < agendav-old.sql

```

## ttrss

from the new server  
install the app from ynh admin  
then import de bdd

```auto
$ mysqldump -u root -p ttrss > ttrss.sql
$ mysql -u root -p
mysql> drop database ttrss;
mysql> create database ttrss;
mysql> exit
$ mysql -u root -p ttrss < ttrss-old.sql

```

then get back your favorites themes  
from the old server

```auto
$ rsync -av /var/www/ttrss/themes/ root@yo.ur.new.ip:/var/www/ttrss/themes/

```

## jirafeau

from the new server  
install the app from ynh admin  
then from the old server rsync the uploaded files

```auto
$ rsync -av /home/yunohost.app/firafeau/ root@yo.ur.new.ip:/home/yunohost.app/jirafeau/

```

## opensondage

from the new server  
install the app from ynh admin  
then import de bdd

```auto
$ mysqldump -u root -p opensondage > opensondage.sql
$ mysql -u root -p
mysql> drop database opensondage;
mysql> create database opensondage;
mysql> exit
$ mysql -u root -p opensondage < opensondage-old.sql

```

## etherpadlite

from the new server  
install the app from ynh admin  
then import de bdd

```auto
$ mysqldump -u root -p etherpadlite > etherpadlite.sql
$ mysql -u root -p
mysql> drop database etherpadlite;
mysql> create database etherpadlite;
mysql> exit
$ mysql -u root -p etherpadlite < etherpadlite-old.sql

```

## owncloud

from the new server  
install the app from ynh admin  
then from the old server rsync each user OC folder

```auto
# be carefull with trailing slashes (see man rsync)
$ rsync -a /home/yunohost.app/owncloud/data/$USER root@yo.ur.new.ip:/home/yunohost.app/owncloud/data/

```

then

```auto
$ chown -R owncloud:owncloud /home/yunohost.app/owncloud/data/$USER

```

and finally re-import your old db

```auto
$ mysqldump -u root -p owncloud > owncloud.sql
$ mysql -u root -p
mysql> drop database owncloud;
mysql> create database owncloud;
mysql> exit
$ mysql -u root -p owncloud < owncloud-old.sql

```

## jappix

from the new server  
install the app from ynh admin  
then backup this metronome folder

```auto
$ mv /var/lib/metronome /var/lib/metronome.old

```

then from the old server

```auto
$ rsync -a var/lib/metronome root@94.23.13.169:/var/lib/

```

again from the new server

```auto
$ chown -R metronome:metronome /var/lib/metronome
$ service metronome reload

```

---

<div class="post-metadata">

**Author:** ![nino](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/n/b9bd4f/32.png) [@nino](https://forum.yunohost.org/u/nino)\
**Post date:** [January 28, 2016, 8:55am UTC](https://forum.yunohost.org/t/yunohost-migration/1250/2 "2016-01-28T08:55:56Z")

</div>

Very good tuto 😄

good syntax rsync:  
rsync -av /var/mail/ root@yo.ur.new.ip:/var/mail

Nino

---

<div class="post-metadata">

**Author:** ![Jean31](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jean31/32/539_2.png) [@Jean31](https://forum.yunohost.org/u/Jean31)\
**Post date:** [March 3, 2017, 7:50am UTC](https://forum.yunohost.org/t/yunohost-migration/1250/3 "2017-03-03T07:50:05Z")

</div>

Super Excellent,

dommage je découvre ce howto après avoir fait ma migration 😕

Sinon j’ai aussi kanboard a migrer et dans l’appli on ne peut faire que des exports de taches pas de board entier avec ces taches?  
une idéees sinon?

Merci a+

---

<div class="post-metadata">

**Author:** ![FugazziPL](https://forum.yunohost.org/user_avatar/forum.yunohost.org/fugazzipl/32/398_2.png) [@FugazziPL](https://forum.yunohost.org/u/FugazziPL)\
**Post date:** [March 3, 2017, 6:42pm UTC](https://forum.yunohost.org/t/yunohost-migration/1250/4 "2017-03-03T18:42:36Z")

</div>

Hum, ce sujet me semble super important et intéressant.

Mais si on peut avoir ce process en Français pour ceux qui ne maitrisent pas la langue de Shakespeare, ce serait top. 😃

Je ne me sens personnellement pas suffisamment à l’aise pour le faire moi-même, parce que je pense faire encore des erreurs dans la traduction, et j’en suis navré.

---

<div class="post-metadata">

**Author:** ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)\
**Post date:** [January 18, 2023, 8:13pm UTC](https://forum.yunohost.org/t/yunohost-migration/1250/5 "2023-01-18T20:13:13Z")

</div>

Closed on January 18, 2023, 8:13pm UTC


