Edit #1 Adding the fact that there are three users on my Yunohost instance. Small enough so I do not have to automate everything and doing the migration by hand. This way, it can also be helpful for more people (the less technical ones)
TLDR / Summary
The objective of this post is to share with the community how I did to migrate my yunohost applications to a new domain name with a new admin user. Everything staying on the same Yunohost server.
Maybe, it will give ideas while the official “move option” is being implemented by all applications maintainers.
There are only three users on my Yunohost instance so I prefer doing it by hand than in the normal IT way of doing stuff (sql dump, etc). It would have been different with ten or more users.
The migration is not yet finished so it is “work in progress”
When I was young, I installed Yunohost to see what it could do. I used a dummy domain name and took a nohost.me. “It’s just a trial right?” Today, I use many applications to manage my digital life as the agenda, contacts or wiki and most of them are tied to the old domain. Some are now on the new domain with the new admin user; So sometimes, I need to switch users to manage settings ( and it is a pain in the but …)
So I would like to change and move everything to the new domain because:
- if the server crash, I will loose control of the
nohostdomain and I will be screwed
- I have a nice domain so it’s better to use it I guess
- No more round trip between my two
admin usersto manager this particular application
Objective (Domain names and users)
My goal is to migrate everything from current to new
domain : alice.nohost.me
admin : alice
domain : myserver.example.org
admin : bob
And as a picture is worth a thousand words :
- Create the new user Bob and set it’s username as bob (in my case) in the administration panel of Yunohost
- Have your own domain name (See https://yunohost.org/#/postinstall/main-domain)
- Have it configured correctly on the registrar to point to your server (you can use sub domain if you want)
- Your Yunohost server is configured to use the new DNS
- Have time and/or knowledge as you could loose information if things are not done correctly
It worked for me but depending on your situation, it should be better to ask before rushing
List of applications that need to be migrated
For some application like Ampache, it was easier to remove them and to install them on the new domain.
It should be the same for Transmission and others I guess but I did not check that yet.
Time for some action !
I choosed to begin with Dokuwiki as there is no database but only plain files so it is easier
What I did :
- Copy the Dokuwiki data to a safe place
- Remove Dokuwiki application from Yunohost
- Re-install Dokuwiki on the new domain and set bob as admin
- Import data from backup
- Apply the new Yunohost configuration to the import data
Connect to the server by SSH
Verify that there is enough free space to do the backup beforehand ! (use
dfor other tool)
sudo su - # Connect as root cd /var/www/ # Move to the folder containing dokuwiki data cp -a dokuwiki/ dokuwiki_bak # Check that your Dokuwiki installation uses the same folder name !
Yunohost admin web interface
- From Yunohost admin panel, remove the Dokuwiki application (You have other backups than the one we just made right? So do not be afraid )
- Re-install Dokuwiki on the new domain
myserver.example.organd set bob as admin
Normally, Dokuwiki has been installed in the folder
dokuwiki. And your old wiki is stored in
Let’s compare the differences :
root@yunohost:/var/www# diff -r dokuwiki/conf/ dokuwiki_bak/conf/ Seulement dans dokuwiki_bak/conf/: acronyms.local.conf diff -r dokuwiki__2/conf/dokuwiki.php dokuwiki_bak/conf/dokuwiki.php 61,62c61,62 < $conf['superuser'] = 'bob'; //The admin can be user or @group or comma separated list user1,@group1,user2 < $conf['manager'] = 'bob'; //The manager can be user or @group or comma separated list user1,@group1,user2 --- > $conf['superuser'] = 'alice'; //The admin can be user or @group or comma separated list user1,@group1,user2 > $conf['manager'] = 'alice'; //The manager can be user or @group or comma separated list user1,@group1,user2 Seulement dans dokuwiki_bak/conf/: local.php Seulement dans dokuwiki_bak/conf/: local.php.bak Seulement dans dokuwiki_bak/conf/: mime.local.conf Seulement dans dokuwiki_bak/conf/: plugins.local.php Seulement dans dokuwiki_bak/conf/: plugins.local.php.bak root@yunohost:/var/www#
Except for the
admin user, there is no other relevant differences in the configuration folder.
Import data from backup
# Merge root@yunohost:/var/www# rsync -a dokuwiki_bak/ dokuwiki root@yunohost:/var/www#
Edit the configuration to change the admin
# Use `nano` or your editor of choice root@yunohost:/var/www# vim dokuwiki/conf/dokuwiki.php # Go to lines 61 and 62 and add `,bob` $conf['superuser'] = 'alice,bob'; //The admin can be user or @group or comma separated list user1,@group1,user2 $conf['manager'] = 'alice,bob'; //The manager can be user or @group or comma separated list user1,@group1,user2
This way, whatever you are connected as Alice or Bob, you will be able to administrate the wiki (add plugins, etc) !
Try the new wiki with your browser on the new address
If everything is okay, you can delete the backups on the server
rm -rf /var/www/dokuwiki_bak
If there is a problem , ask for help here or on the forum
To be continued !