Following Nodejitsu's recent news about shutting down its PaaS service, Ninefold also recently announced that they are sunsetting their Rails deployments in just 3 months. Though we understand their reasoning around this, it has caused quite a stir in the Rails community as people start to look at alternative services. We have received countless questions about how best to migrate an app to Cloud 66, and this post will outline the process.
When it comes to any migration of this sort, there are three components: code, data and traffic. You can follow this step-by-step process to complete your migration:
- Visit Cloud 66 and click Build a classic stack, which will ask you for your Git URL, the branch you wish to deploy, your new stack name and the environment to deploy.
If your Git repository is private, you will need to add the SSH key provided to your Git account and use the SSH version of the Git URL.
- Once you've clicked Analyze, Cloud 66 will analyze your code to determine what dependencies you have - which version of Rails and Ruby you are running, if you need a database and so on. The results of this analysis will be displayed on the next page.
- After analysis, you'll be asked to input the API keys for your cloud provider, which will allow us to connect to a cloud of your choice to create your servers. You can also choose the region to create your server(s) in and the server size.
- Upon clicking Deploy stack, Cloud 66 will create the required servers in your cloud account, configure them from scratch by updating packages, securing your firewall, installing Nginx and many more steps. Once this is complete, your application will be running on servers in your own cloud, ready for you to use.
- You will now want to export your database from Ninefold, and you can refer to the Ninefold instructions on how best to do this on their platform.
- Once you have your database, you can upload it to your Cloud 66 database by running the following command with our command line toolbelt:
cx upload -s <stack_name> <database_server_name> backup.sql /tmp/backup.sql
- With the file uploaded, you can now SSH to this server:
cx ssh -s <stack_name> <database_server_name>Depending on whether you're using a MySQL or PostgreSQL database, you can import it with one of the following commands (the credentials for your database are available on your database server page):
sudo mysql -u <username> -p <password> <databasename> < /tmp/backup.sql sudo -u postgres psql -U <username> -p <password> <databasename> < /tmp/backup.sql
- To switch your traffic to your new Cloud 66 stack, access your DNS provider settings and update your CNAME records to point at your new server.
This is a brief outline of the steps involved when migrating your apps to Cloud 66. If you have any questions around how this can work for you, don't hesitate to get in touch.