I had experience with migrating a CMS to AEM in the past, and here's what I've done:
In the old CMS, you need to expose structured JSON that AEM can use to create pages; this includes page properties and components properties; a JSON schema per root page, so, for example, like:
mywebsite.com/migration-api/services.json (this exposes all child pages under services for your servlet's consumption)
Identify which page elements are components and expose JSON promptly (forward-thinking of which components to create in AEM)
Create new components in AEM.
Ensure that these components are re-usable, and can be flexible. What properties would you like the author to control?
Create templates using the new components.
Create empty pages as clone-ables using those templates. These pages will be used by the servlet to create new pages.
AEM Servlet, PageManager, and JCR API
Create an AEM Servlet that consumes the structures JSON (from the old CMS)
The AEM Servlet will copy(clone) the clone-able pages to create new pages in AEM; use the PageManager and JCR API
Use a service user to get the AEM session, so you have the correct permissions to create, delete, write, to the JCR.
Use the (Gson Java Class API or Jackson Java Class API), and use JCR API to fill in page properties and component properties as required.
Validate: ensure the pages are working as expected.
Note: it would be a bit more challenging when preparing structured JSON if your old CMS is Wordpress, because the page is constructed as an rich-text HTML code; you would need to identify similarities and understand what the best possible way it is to expose JSON for page properties and component properties.
For page migration would be bit tricky as mentioned by @Briankasingli , As the component structure in your existing CMS and AEM might not be same, which would require you do define mapping between the components and properties. Also it will be hard to identify all the content which is used in multiple pages, So you can create it as a Experience Fragment and reuse. Also using features like inheritance would be tricky. It all depends on the website content and complexity. Do consider manual content creation as an option if the site has fewer pages, if part of the site follows same structure and uses few/same components then you can write custom code to migrate it like product details page, help articles.