Migrate servers from Forge to Ploi
Published 28 January 2021 10:46 (5-minute read)
After using Laravel Forge for years, it is time to look for something different. I came across Ploi, which offered more features that I wanted to use. But, how did I migrate my servers to Ploi?
When you are working a while with a solution, you need to ensure that everything also works with the other solution. That's why I first tested some dummy projects on a server provisioned by Ploi.
The experience with setting up a server, adding sites, and configuring backups were nice. There were a few things that could be improved, so I submitted them to the public roadmap. Here you can suggest improvements and/or new features to the dashboard.
So, now I have a few servers in Forge. But migrating them to Ploi would take some time. I contacted Dennis, the owner of Ploi. He has a (concept) solution that could be useful for me. So, let's see what this solution is.
The solution, made by Felix Schmid, helps you migrate servers from Forge to Ploi.
It's also possible to manually migrate all your servers, but this tool will do most of the work for you.
The process is straightforward; create an account by the migrator. After that, you get guided through the application.
Note: to migrate the server, you need to set up a new server (instructions will come during the next steps). It's not possible to migrate the current server installation from Forge to Ploi.
First, it will ask you to provide the needed API keys. This is how the application communicates with Forge & Ploi.
All actions will be saved in the migrator tool until your start the migration. From that moment, it will actually migrate the data from the Forge to the Ploi server.
There are some settings needed for the migration. These settings are for the quality of life; else, you need to do this yourself.
You need to select the server you want to migrate. These servers are coming from your Forge account.
Select the servers you want to migrate and choose which "server provider" the new server will be installed.
It's also possible to use a "custom server". If you have a custom server, you need to install the server with a clean ubuntu 16.04, 18.04, or 20.04 installation. The migrator will give you the instructions you need to install the server after you started the migration.
All databases that need to be migrated can be selected here.
Note: the password on the new server will be changed, the migrator will change the .env password. But, be sure to check for other usages of the old password manually.
Sites are a bit more complicated. You can have Laravel project, static HTML, Statamic, or WordPress websites. The migrator lets you select all sites, and if possible, shows you an option to migrate the /storage directory as well.
After you passed all steps, you can see an overview of the things that will get migrated.
Be sure to allow the migrator to access your old & new server. Also, your old server needs to access the new server. This can be done by adding the IP to the whitelist (if you enabled IP whitelisting).
If you are ready, you can start the migration at the bottom of the summary overview.
Now it's time to start the migration. Everything is set and ready to go.
When you selected a server provider, it will start the migration direct by installing the server.
By a custom server, you need to configure the server manually. Connect via ssh to the server and run the command.
You then instruct the migrator to install the server (this will be done via Ploi).
The server installation takes up some time, but the migrator will inform you every few minutes about the status and action during the process.
After the server installation is complete, the migrator processes all the recipes. These are individual tasks and run in parallel.
The moment is there; within 10-15 minutes (depending on the server's size), all sites, databases, storage directories, firewall rules, ssh keys, jobs, and daemons are migrated from the old Forge to the new Ploi server.
I really loved the way Felix made this tool. It guides you through the process. After you start the migration, it shows how the migration went and its steps to complete it.
Note: I just used this tool to migrate my servers from Forge to Ploi and share the experience with others.