Best practice for migrating apps from one Cloudron to another?
-
I need to move a bunch of apps from one Cloudron to another.
What's the best way to do this?
Struggling to get my head around the correct order to do things in...
Like, when should I add the domain used for the app to the new server?
I'm guessing perhaps I should do something like this:
- make a backup of the app on the existing server.
- install the same version of the same app on the new sever on some temporary domain
- import the back of the app
- check everything seems to be working (although I guess this will be hard with apps that don't like their domains changing too much, like Mastodon, Peertube etc - but even WordPress I find often has lots of references to the old/ new links all over the place and I tend to need to use something like the Better Search Replace app to find and change them all)
- add the relevant domain to the new server
- re-create any mailboxes you had set-up on old server at the relevant domain (you may also wish to import email first before actually updating the DNS)
- change the domain of the new copy of the app on the new server to the domain it was using on the old domain
Does that sound about right?
-
Here's the previous thread on this topic with an example flow:
https://forum.cloudron.io/topic/9347/how-to-automate-migrating-importing-apps-from-cloudron-to-cloudron-via-api -
@jdaviescoates sounds about right. I think you don't need to worry too much about 4 because this will only be "temporary" until you give the app the same domain as before.
-
@girish said in Best practice for migrating apps from one Cloudron to another?:
I think you don't need to worry too much about 4 because this will only be "temporary" until you give the app the same domain as before.
Perhaps when it comes to the domain itself there is nothing to worry about, but methinks "check everything seems to be working" is pretty important!
For example, I just migrated a Ghost app and after the migration it was not longer possible to subscribe to the newsletter.
In the logs I saw this:
Sep 08 12:22:56Failed to send email. Reason: Mail command failed: 550 Authenticated user support@bridport.news cannot send mail as ghost@bridport.news. Sep 08 12:22:56 Sep 08 12:22:56"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."
So I edited the App Email settings and changed
ghost.app
tosupport
:And then it started working again.
But the odd thing is that in the App Email settings on the old server it has always been and is still
ghost.app
I can only guess that it was working there because I had set-up the required email addresses that are set in the portal settings in Ghost:
I guess when Cloudron couldn't find that mailbox on the new server it tried to just send as 'ghost.app' instead?
For good measure I think I'll add a step to my post above to re-created any needed mailboxes before updating the location to the new domain...
-
@jdaviescoates said in Best practice for migrating apps from one Cloudron to another?:
re-create any mailboxes you had set-up on old server at the relevant domain (you may also wish to import email first before actually updating the DNS)
I went ahead and updated the DNS before realising I should do this first!
What should I do now if I want/ need to import the old emails? (in this case I don't think I really need to, but be good to know). Go back to the old server and re-set-up the DNS there, do the imports and then set-up the DNS on the new server again?
-
@jdaviescoates Oh, I think this is a bug in import app. It's not importing the mailbox configuration. I will try to reproduce.
-
@girish said in Best practice for migrating apps from one Cloudron to another?:
not importing the mailbox configuration.
Do you mean the app email settings?
-
@jdaviescoates yes, the app email settings is not imported.
-
@girish said in Best practice for migrating apps from one Cloudron to another?:
@jdaviescoates yes, the app email settings is not imported.
Perhaps that is indeed the case, in which case I'm glad I've inadvertently found a bug!
But in my case (as mentioned above) the original app I imported still actually had
ghost.app
in the app email settings too.I think the cause of my issue may have been that I hadn't created the relevant mailboxes for the domain which the app (in the Ghost settings, not the Cloudron App Email setting) was configured to use.
Be nice if when importing an app it could somehow know about and import related mailboxes on that domain too though...
-
@jdaviescoates said in Best practice for migrating apps from one Cloudron to another?:
I think the cause of my issue may have been that I hadn't created the relevant mailboxes for the domain which the app (in the Ghost settings, not the Cloudron App Email setting) was configured to use.
Ah! I misread your issue then. You are right, that mailbox has to be created manually. Mmmm... I wonder how the user can be reminded of this. I think for a start having this in the doc page as a checklist (which is what this thread is about!) will help.
-
@girish said in Best practice for migrating apps from one Cloudron to another?:
Ah! I misread your issue then.
Yeah, I think you missed or misread this bit:
@jdaviescoates said in Best practice for migrating apps from one Cloudron to another?:
But the odd thing is that in the App Email settings on the old server it has always been and is still ghost.app
I can only guess that it was working there because I had set-up the required email addresses that are set in the portal settings in Ghost:
41999d97-12f0-41e3-b47b-b95114bcdca2-image.png
I guess when Cloudron couldn't find that mailbox on the new server it tried to just send as 'ghost.app' instead?
But yeah, as you say, would be good to somehow remind users this might need to be done too, like you say:
@girish said in Best practice for migrating apps from one Cloudron to another?:
Mmmm... I wonder how the user can be reminded of this. I think for a start having this in the doc page as a checklist (which is what this thread is about!) will help.
Agreed
But maybe whenever importing an app a pop-up could appear saying something like "you might also need to recreate mailboxes on this domain" or something?
-
@hpz24 said in Best practice for migrating apps from one Cloudron to another?:
Now I'm curious: does an app actually survive the move to another cloudron instance with a different domain?
In most apps, yes. The federated apps like mastodon and matrix are a special case. They don't support changing the domain . Even though the app itself will work after changing the domain, expect bad things to happen (tm) after domain change. For example, not seeing proper history of old message etc. I haven't tried this much, so this is just a warning really.
-
-