Migrating your application between servers
Migrating between servers
1. Set a failover group
- On your dashboard click on Failover Groups
- Add a new failover group
- Choose application
Aas the primary instance
- Click on “add group”
2. Add a CNAME record in your DNS provider dashboard
To point at the address provided in the failover group and wait for 24 hours to propagate. While you are waiting for the DNS to get propagated you can follow the steps until step 8.
If TTL of your DNS is 300 seconds you don't need to wait - just complete the process.
3. Database backup
A, set backup for your databases (using the Database Backup Add-in).
4. Clone primary application
Visit the overview page for application
A and click Clone in the right sidebar. This will allow you to choose a new application name and environment. Cloning your application will preserve any environment variables from the existing application, and also allows you to define where to deploy along with other settings.
5. Add your database to the backup application
Add database or all the databases you need on to the application
B (the clone)
6. Set up replication between applications
B go to the database server (Redis, MySQL or etc.) and choose the server. On the right sidebar click on “configure replication” choose application A (you have to be Administrator on application
A otherwise it won’t be listed). This makes application
B database into a replica for application
7. Add the second application to the failover group
To add application
B as a backup to the failover group, edit the related failover group and add application
B as a backup.
Make sure DNS record for the failover group is populated.
8. Put the primary application into maintenance mode
- Go to the overview page for application
- Click on Network
- Click on the Redirects tab
- Check “Put application in Maintenance Mode” box
- Click Apply Redirects
9. Change the second database master
Follow step 6 again but this time in the drop-down menu choose “No data source” (this makes
B’s DB into the master)
10. Switch to the new application
Go to the failover group and switch to application
B. We recommend you keep the DNS on the failover group to make this procedure easy in the future.
11. [OPTIONAL] Switch your DNS record to the new application
You can now point your DNS to application
Migrating between data centers
Do you want to move your application from one cloud vendor or region to another? Follow the steps below for a seamless transition between applications.
- Reduce the TTL of your DNS to 5 minutes, and leave it for 24 hours so that it has time to propagate the network.
- Clone your application and deploy it to the new data center. This will save any environment variables you had configured on the source application.
- Set up your target application as a database replica, which means that any changes to your source database will be replicated across to the target application until you switch it off. OR
- Use our one-time database import feature to migrate your data across.
When you’re happy with this new application, simply switch your DNS over to it. As the TTL is 5 minutes (set earlier), it should take effect quickly.
If you followed step 3 above, switch the target database from being a replica to a master (as outlined in the database replication between applications documentation).