Dev Blog #1: Migrating our web stack to Técnico's VPS and some news
Until now, we'd been running our platform on a Hetzner server deployed on Appliku, and as of today we just completed a migration to an OpenStack VPS provided by Técnico. This post covers what we did, why we did it, and the technical steps involved.
Why We Migrated
Appliku is a great platform for getting things running quickly and abstracts away a lot of the complexity of deploying Dockerized apps. However, as our project matured, we wanted more control over our infrastructure and a way to reduce costs. If you know the right people (thanks to our scientific advisor / INESC!), Técnico provides a VPS service for projects on their cloud infrastructure, which gave us an opportunity to eliminate hosting fees entirely and gaining ownership of our deployment pipeline.
The Migration Process, and some quirks
Our web stack is a Django application backed by PostgreSQL (with PostGIS for geospatial support) and served through Gunicorn behind an Nginx reverse proxy, all containerized with Docker. We also store user-uploaded media files including profile photos, CVs, and meeting documents.
We provisioned a new Ubuntu 22.04 instance on Técnico's OpenStack infrastructure, configured security groups to allow HTTP and HTTPS traffic, and assigned a floating IP for external access.
Migrating the Database and Media: We used PostgreSQL's pg_dump tool to dump the database from the old server, SCP'd it over to our local machine and then to the new server. Finally, we dropped and rebuilt the database on the new instance, restoring the data across cleanly. User-uploaded media files, such as profile pictures and PDFs, were stored inside the web container on Appliku. We archived that directory as a tarball and restored them into the Docker volume on the new server.
SSL and Domain Configuration: We set up HTTPS with Certbot, configured Nginx to handle SSL termination and redirect HTTP requests to HTTPS. We also secured a free! domain orbiswater.pt thanks to amen.pt! WIP
Keeping the Old URL Working: Ensuring continuity for anyone who had bookmarked or shared our old URL was a priority. Since orbis.applikuapp.com is a subdomain managed entirely by Appliku, we had no direct control over where it pointed. To work around this, we did the most overkill thing and set up a redirect app on a Google Cloud instance, registered it as a server on Appliku, and deployed a barebones Nginx container whose sole job is to issue a redirect to the new server. It was a roundabout approach, but it means any materials referencing the old URL remain valid. Engineers..
In Other News
The Dev team has been hard at work building out our infrastructure. I have been personally responsible for the gateway, blockchain, and transactional algorithms. @Tomás Ribeiro has been working on daemons that run at the node level and binary packetised communication protocols, and @Francisco Caravana has been working on authentication algorithms and card info hashing.
On top of that, our geospatial dashboard can now be demoed here! Give it a spin!
Tiago Lopes Carvalho
Matilde Silva
Francisco Caravana
Margarida Sebastião
Tomás Ribeiro