After more than one year with $500 of credits at RunAbove, OVH decided to close its beta compute IaaS. I didn't think it was closing soon and already invest a lot in: I hosted my weblog there, implement libcloud compute driver, have a pending pull request for libcloud storage driver and also plan to add ansible module.
All that code isn't wrote in vain, I think it will be easily updated for work with OVH's API, but I need a new hosting service and fortunately I'm currently working at Gandi and I take advantage of their Cloud platform. Result: I simply have to spawn a new VM at Gandi, launch my Ansible playbook, import a database backup plus media files and change the DNS.
Because of my new job, I didn't make an entry for a while and moving my website is great opportunity to test its agility, and also a great occasion to make a blog post.
My new virtual machine
Gandi has a fully documented XML-RPC API (we are preparing the REST one), but I won't lie I use the web interface to create my server. For make a little comparative study between Gandi and other cloud providers':
- There's no VM flavor/type (coming soon): You must define how many CPU cores, among of memory and root disk size
- There's a flexible block storage with 2To max per volume
- There's no public image catalog
- You can choose how many network interfaces
- You have the choice between 3 locations: France, Luxembourg and USA
My playbook
It's been a long long time, I didn't launch my playbook, especially on freshly created server. I was a little afraid because I made a lot of hacks inside and I didn't take the time to ensure it with CI. A little bit fearful, I uploaded my SSH key and launched:
ansible-playbook main.yml -i hosts -u root -vvvv
Effectively it failed...
Not affraid by errors, I was preparing for a boring debugging and in beginning of this long road I realize I only forget to add dependencies for my recent update about Django-CV. I apt-get install libjpeg-dev
, fixed 2-3 stuff, launched the playbook again and all is great: I've got a new instance of my blog.
Import data
Here, I already protected my a*#, I am administrator of Django-DBBackup so the process was quite simple for me, I launched on my old server:
myblog dbbackup
myblog mediabackup
And on my new server:
myblog dbrestore
tar -xfz media.backup.tar.gz
In real life, there were more commands because I didn't have a cloud storage to store my data. But for make an ad to DBBackup, it is actually possible to proceed like this and mediarestore
is planned to be implemented.
Change DNS
Fate of circumstance, Gandi is also a domain name registrar, all is done with the same provider.
Conclusion
I ever tried to make my blog an application as flexible as possible. Now I take the benefits of my agnostic development and It took me aproximatively 20 minutes for migrate my website.
Comments
No comments yet.