How to migrate AdGuard Home from a GL.iNet Flint 2 router to a Libre Sweet Potato

I love the Flint 2 router from GL.iNet, but the built-in AdGuard Home cannot handle the amount of devices, blocklists and custom filter rules I need. It crashes when I try to search the query log or add new custom filters, so I decided to take my config and migrate it to a Sweet Potato, and those issues disappeared.