Server migration tips? Need same ubuntu version? Possible to do without downtime?
-
Hi all,
I'm about to attempt my first Cloudron server migration.
My current Cloudron server is still running Ubuntu 18.04
My new Cloudron server is on Ubuntu 20.04Do I need to update my existing server to 20.04 before migrating?
And if you've done a migration before, do you have general tips/ things to bear in mind?
I'm thing I'm already unclear about is how best/ when to make DNS changes.
Thanks in advance for your thoughts an tips!
-
Hi @jdaviescoates,
@jdaviescoates said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
Do I need to update my existing server to 20.04 before migrating?
no, the only thing that matters for this is the version of Cloudron itself. The OS does not need to have the same version pre and post migration.
Without any downtime is not possible. At the very least you need to account for the time the restore actually takes (so in case the backup location is either local to the new server or on a really fast internal network). DNS migration was for me no problem the last time, since I am using Cloudflare for dns and there Cloudron will take care of updating dns records automatically.
I went a similar route some time ago and also went a bit overboard with preparation. So I ended up creating a small script that triggers the full cloudron backup, polls if the backup has completed successfully and then shut down the old server (plus sending me a simple notification through telegram). I linked to my script and writeup in https://forum.cloudron.io/post/47255.
-
@fbartels said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
no, the only thing that matters for this is the version of Cloudron itself.
Thanks good to know.
Be good if it were explicitly stated that Ubuntu version doesn't matter in the docs (although I guess it does matter with new not fully supported versions).
-
OK, so I've hit my first hurdle:
My backup is using a Filesystem (Mountpoint) because when I first purchased my Hetzner Storage Box (back before Cloudron automated mounting stuff) I just followed Hetzner instructions on how to mount the Storage Box.
But of course my new server doesn't yet have anything mounted yet at
/mnt/backup
Not sure how best to proceed?
I guess perhaps my only option given the circumstances would be for me to manually mount my Hetzner Storage Box to my server at /mnt/backup before proceeding?
-
@jdaviescoates said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
But of course my new server doesn't yet have anything mounted yet at /mnt/backup
I'm wondering if I'll hit similar issues with existing Volumes too (I think I set some of those up before Cloudron automated stuff too)...
-
@jdaviescoates Can't you mount the storage box in the restore UI?
-
@girish said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
@jdaviescoates Can't you mount the storage box in the restore UI?
Oh, you mean ignore the fact that it auto loads the backup configuration as Filesystem (Mountpoint) and just choose CIFS instead and enter relevant credentials?
I guess you do, because that worked, thanks!
Just doing a Dry run now...
-
OK, so my next issue is that one of my Volumes (the one with my ebooks on) was actually a Hetzner Cloud Volume mounted into my Hetzner VPS so now Calibre Web isn't working because it can't locate the files...
So I guess I somehow need to copies the files off of the Hetzner Cloud Volume somewhere else and then add the new somewhere else as a new volume and then add it to my Calibre web...
-
@jdaviescoates said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
OK, so my next issue is that one of my Volumes (the one with my ebooks on) was actually a Hetzner Cloud Volume mounted into my Hetzner VPS so now Calibre Web isn't working because it can't locate the files...
So I guess I somehow need to copies the files off of the Hetzner Cloud Volume somewhere else and then add the new somewhere else as a new volume and then add it to my Calibre web...
Actually, in this case, now that I've got loads more disk space on my server I may as well just store all my books on it instead of having them on an external volume.
So now trying to upload a 8GB zip file via the File Manager... not sure that's going to work...
-
@jdaviescoates said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
So now trying to upload a 8GB zip file via the File Manager... not sure that's going to work...
Can confirm, we have never tested such big sizes Let us know how it goes...
-
@girish said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
Can confirm, we have never tested such big sizes Let us know how it goes...
Took a LONG time, but...
Worked!
8.76GB. Pretty sure that wouldn't have worked on my old laptop, but this one has 64GB ram, so that's gotta help!
re the amount of time it took: is there a way I could've ssh'd into /app/data/ instead and just used scp or something?
-
@fbartels said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
Without any downtime is not possible.
It seems that using the Dry run feature perhaps it is possible to do without any downtime, because then you can wait for everything to restore before syncing DNS...
That's what I'm going to try anyway, then once it seems DNS has propagated I'll power down my old server and it should be all smooth...
-
OK, so it seems to have gone very smoothly!
One thing I didn't properly think about though: email
I'm now missing a few hours of email (the time between the time I took the back I restored to the new server and making DNS changes live).
I obviously still have the email on my old server, but how to get them over to the new one? @girish (I'd guess @d19dotca might know too? )
And another email issue too: of course my IP has now changed, and joy! 3 blacklists have my IP on
If I'd thought about it I would've checked that before moving Cloudron to a new server and get the IP off the lists beforehand. Would be good to add this suggestion (checking IP of new email on spam blacklists and attempting to get it delisted before moving) to the docs.
I think there may be a bug in the UI too. My IP is on blocklists but this is how it looks under email status - correct red sign, but incorrect text (which I guess should be listing the blocklists the IP is on?):
And another email thing: need to change the PTR record on my new server as well (also worth adding to the docs methinks)
I needed to Renew certs too.
-
@jdaviescoates I haven’t really had to manually transfer mail over yet but if you still have the old server running I suppose you could follow the steps here: https://docs.cloudron.io/backups/#restore-email
In my experience of moving servers I’ve usually actually shut down the mail container during the backup process so that it can’t take any new email and that way I know the backup is the absolute latest. Then I don’t turn it back on ever on the old server and immediately update the DNS and PTR records to point to the new server and propagated a bit.
-
@d19dotca said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
if you still have the old server running I suppose you could follow the steps here: https://docs.cloudron.io/backups/#restore-email
I don't think that will help me right now as the missing emails are in any backups (yet).
I guess I could try:
- add the ip of my old server to my /etc/hosts file on my laptop so I can access it again post DNS changes
- boot up my old server and run a backup
- Then try the restore email thing linked above by copying the relevant files from one server to the other (not sure how exactly I'd do that, I guess maybe with scp or something)
But I wonder if another option would be to
- add the ip of my old server to my /etc/hosts file on my laptop so I can access it again post DNS changes
- boot up my old server and run a backup
- restore this new backup of the old server into the new server (although I guess this could now get messy - what would happen with emails that have since arrived on the new server).
I think I'll wait for some input from @staff before proceeding...
-
@jdaviescoates said in Server migration tips? Need same ubuntu version? Possible to do without downtime?:
I guess I could try:
add the ip of my old server to my /etc/hosts file on my laptop so I can access it again post DNS changes
boot up my old server and run a backup
Then try the restore email thing linked above by copying the relevant files from one server to the other (not sure how exactly I'd do that, I guess maybe with scp or something)But I wonder if another option would be to
add the ip of my old server to my /etc/hosts file on my laptop so I can access it again post DNS changes
boot up my old server and run a backup
restore this new backup of the old server into the new server (although I guess this could now get messy - what would happen with emails that have since arrived on the new server).I'd recommend the first option there to avoid overriding any emails on the new server which aren't on the old server. The first steps would be good because then you'd get a backup again you can follow the steps from the docs at that point to restore emails, essentially merging with the new server afterwards.
Definitely will be interested if @staff has any other recommendations though, will be good to know for future.