# Website Migration Readiness Checker (`practical_ai_lab_jp/pal-website-migration-readiness-operations`) Actor

Check a public HTTPS site before and after a migration: redirects, status codes, canonicals, sitemap, content types and links, compared across runs and ranked by severity.

- **URL**: https://apify.com/practical_ai_lab_jp/pal-website-migration-readiness-operations.md
- **Developed by:** [Practical AI Lab](https://apify.com/practical_ai_lab_jp) (community)
- **Categories:** E-commerce, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 migration comparison reports

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Website Migration Readiness Checker

Check a public HTTPS website before and after a migration and get one severity-ranked fix list.

Give the Actor the site root. It reads `robots.txt`, samples pages that robots rules allow, and checks redirects, status codes, canonicals, the sitemap, content types and internal links. It saves a snapshot per site, so the next run reports what changed: what broke, what got fixed and what disappeared.

### Who it is for

The person who owns a website migration (domain move, replatform, URL restructure, HTTPS or CMS change) and needs a short, prioritised list to hand to developers and SEO or content owners, plus evidence of what changed between rehearsal and launch.

### What you get

Every run produces one joined report. Findings are ranked by a priority score (severity, whether it is new, how many sampled pages link to it, whether the sitemap lists it) and grouped into four workstreams, each with its own hand-off:

| Workstream | Buyer outcome | Examples of findings |
| --- | --- | --- |
| `redirect_map` | A clean redirect map | redirect chains and loops, temporary redirects, redirects that downgrade to http or leave the origin, 404/410/5xx/403 targets |
| `indexing_signals` | Pages that can be indexed | missing, conflicting, cross-host or non-self canonicals, canonical targets that redirect or fail, `noindex` left over from staging, HTML served with the wrong content type, a robots.txt that blocks the site |
| `sitemap_hygiene` | A trustworthy sitemap | missing or broken XML, URLs on another host or over http, sitemap URLs that redirect or are blocked by robots.txt, orphan candidates, URLs dropped since the earlier snapshot |
| `link_integrity` | No dead ends | internal links that return errors or redirect, links removed from a page since the earlier snapshot |

#### Run statuses

| Status | Meaning | Chargeable |
| --- | --- | --- |
| `BASELINE_CREATED` | First run for this site and phase. The findings are listed and the snapshot is stored. | No |
| `NO_CHANGES` | Nothing differs from the comparison snapshot. | No |
| `CHANGES_DETECTED` | Findings appeared, worsened or were resolved, page state changed, links were removed or sitemap URLs were dropped. | Yes (one event per run) |
| `BLOCKED_BY_ROBOTS` | robots.txt disallows the start page for this crawler. Nothing was analysed. | No |
| `FAILED` | Invalid input, unreadable robots.txt, unreachable start page, or an unreliable sample. | No |

Only a run that delivers a comparison with detected changes is chargeable. Baseline, no-change, blocked and failed runs are never charged.

### Quick start (copy this input)

```json
{
    "startUrl": "https://example.com",
    "phase": "prelaunch",
    "maxPages": 25
}
```

Replace `https://example.com` with your own site root. The first run returns `BASELINE_CREATED` with the current findings. Change something on the site (or wait for the launch), run again and you get the comparison.

A typical migration flow:

1. Run with `"phase": "prelaunch"` against the site as it is, and again after every fix batch. Each run compares with the previous prelaunch run.
2. Right after the switch, run with `"phase": "postlaunch"`. The first postlaunch run is compared with the latest prelaunch snapshot, so you see exactly what the launch changed.
3. Later postlaunch runs compare with the previous postlaunch run. Use `"compareWith": "prelaunch"` to compare with the prelaunch snapshot again.

### Input

| Field | Required | Default | Notes |
| --- | --- | --- | --- |
| `startUrl` | yes | - | HTTPS site root, no path, query or credentials. |
| `phase` | no | `prelaunch` | `prelaunch` or `postlaunch`; each keeps its own snapshot. |
| `compareWith` | no | `auto` | Postlaunch only: `auto` or `prelaunch`. |
| `maxPages` | no | 25 | 1 to 100 sampled pages, including the start page. |
| `maxSitemapUrls` | no | 2000 | 50 to 10000 sitemap URLs read before sampling. |
| `maxLinkChecks` | no | 30 | 0 to 100 linked URLs fetched to detect broken links. |
| `requestDelayMs` | no | 500 | 250 to 5000 ms between requests. A `Crawl-delay` in robots.txt (up to 10 s) wins if larger. |
| `resetBaseline` | no | false | Replace the stored snapshot for this phase with this run. |
| `stateStoreName` | no | `pal-website-migration-readiness-state` | Named key-value store used for snapshots. |

### Output

- **Dataset**: the first record is the run summary (`recordType: "summary"`: status, readiness verdict, sample size, counts, workstream hand-offs, top actions and caveats). The following records are remediation items (`recordType: "remediation_item"`) with `rank`, `severity`, `workstream`, `code`, `change`, `url`, `detail`, `remediation`, `evidence`, the `before` and `after` page state, `sourceUrl` and `checkedAt`.
- **Key-value store** of the run: `OUTPUT` (summary), `REPORT_JSON` (summary, items and page comparison), `REPORT_CSV` (remediation items) and `PAGE_COMPARISON_CSV` (one row per sampled page with before and after status, final path, redirects, canonical, content type and noindex).
- **State store**: one snapshot per site and phase, containing URL paths, status codes, canonical paths, content types, internal link paths and finding codes. No page text, titles, e-mail addresses or phone numbers are collected or stored.

The readiness verdict is `BLOCKERS_FOUND` (open critical or high findings), `REVIEW_RECOMMENDED` (open medium findings) or `NO_BLOCKERS_IN_SAMPLE`. The last one only describes the sample; it is not a guarantee about the whole site.

### Scheduling

Create an Apify Task with the input above and schedule it, for example:

- during a migration project: once per day with `"phase": "prelaunch"`, so every fix batch shows up as resolved findings;
- around cut-over: a manual `postlaunch` run immediately after the switch, then hourly for the first day;
- after launch: a daily or weekly `postlaunch` run to catch regressions. Runs without changes are not charged.

Keep `maxPages`, `maxSitemapUrls` and `maxLinkChecks` constant between scheduled runs so that comparisons are like-for-like.

### How it stays polite and safe

- Only an `https://` site root on port 443 is accepted. IP addresses, `localhost`, internal host names and hosts that resolve to private or reserved addresses are rejected, and connections go to the validated address.
- `robots.txt` is read first and obeyed (user-agent group matching, `Allow`/`Disallow` with `*` and `$`, `Crawl-delay`). If it cannot be read safely the run stops. If it disallows the start page the run ends as `BLOCKED_BY_ROBOTS`.
- Redirects are followed only within the same origin over HTTPS, up to 5 hops. A redirect to another host (including www and non-www) or to http is reported but never followed.
- Sequential requests with a delay; hard limits on requests per run, response sizes (1 MB per page, 5 MB per sitemap), sitemap files (10), sitemap nesting (2 levels) and sitemap URLs.
- Sitemap XML containing `DOCTYPE` or entity declarations is refused.
- No login, cookies, proxies, forms, contact details or personal data. `mailto:` and `tel:` links are ignored, and URLs that contain an e-mail address are dropped.

### Limitations and sample-size caveats

- **This is a sample, not a full crawl.** With `maxPages` of 25 on a site with thousands of URLs, a clean report means the sample is clean. The summary states how many pages were fetched and what share of the discovered sitemap that represents.
- **Sample selection is stable.** The start page is always included, then the pages from the earlier snapshot (so before and after are like-for-like), then a deterministic hash-ordered selection of sitemap URLs. About a fifth of the slots is kept for URLs not seen before, so new pages can enter the comparison.
- **Orphan results are candidates.** Inbound links are only counted from sampled pages. When the sample covers less than half of the sitemap, orphans are reported as a single low-confidence finding, not per URL.
- **Links and canonicals come from static HTML.** JavaScript-rendered content, region- or device-specific responses and pages behind a login are not seen. A page can look different to a real browser.
- **Single vantage point and time.** Caches, CDNs and deployments in progress can produce temporary differences. Re-run before acting on a single surprising result.
- **Same origin only.** Domain moves are visible as cross-origin redirects, but the new origin must be checked with its own run.
- **Compressed sitemaps (`.gz`) are not read**; point the check at an uncompressed sitemap to include it.
- **robots.txt matching** follows the common longest-match rules but does not percent-decode paths, and only the `*` and `$` wildcards are supported.
- **Dropped sitemap URLs** are only detected when neither sitemap was truncated by the configured limits.
- Runs where more than half of the sampled pages time out, return server errors or rate-limit are marked `FAILED` and nothing is saved or charged, so a short outage does not overwrite your baseline.
- Snapshot data is stored in a named key-value store in your Apify account until you delete it.

### Responsible use

Run this Actor only against sites you own or are authorised to check. It identifies itself with the user agent `PALMigrationReadinessBot`.

# Actor input Schema

## `startUrl` (type: `string`):

Public HTTPS site root of the site being migrated, for example https://example.com. No path, query or credentials. Replace the example with your own site.

## `phase` (type: `string`):

Use 'prelaunch' while preparing the migration and 'postlaunch' after the switch. Each phase keeps its own snapshot.

## `compareWith` (type: `string`):

Only used for postlaunch runs. 'auto' compares with the previous postlaunch run, or with the prelaunch snapshot on the first postlaunch run. 'prelaunch' always compares with the latest prelaunch snapshot.

## `maxPages` (type: `integer`):

Number of pages fetched and analysed, including the start page. Larger samples give more reliable orphan and link results but take longer.

## `maxSitemapUrls` (type: `integer`):

Upper limit of sitemap URLs collected across all sitemap files before sampling.

## `maxLinkChecks` (type: `integer`):

Internal link targets found on sampled pages that are fetched to detect broken or redirecting links. Set 0 to skip.

## `requestDelayMs` (type: `integer`):

Pause between requests to the site. A larger Crawl-delay in robots.txt (up to 10 seconds) overrides this.

## `resetBaseline` (type: `boolean`):

Discard the stored comparison base for this phase and create a new baseline from this run.

## `stateStoreName` (type: `string`):

Named key-value store that keeps snapshots between runs (lowercase letters, digits and hyphens). Snapshots contain URL paths and status data only. Leave blank to use the run's default store, which only persists between local runs.

## Actor input object example

```json
{
  "startUrl": "https://example.com",
  "phase": "prelaunch",
  "compareWith": "auto",
  "maxPages": 25,
  "maxSitemapUrls": 2000,
  "maxLinkChecks": 30,
  "requestDelayMs": 500,
  "resetBaseline": false,
  "stateStoreName": "pal-website-migration-readiness-state"
}
```

# Actor output Schema

## `results` (type: `string`):

Download rows from the latest run in JSON/CSV.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrl": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("practical_ai_lab_jp/pal-website-migration-readiness-operations").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrl": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("practical_ai_lab_jp/pal-website-migration-readiness-operations").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrl": "https://example.com"
}' |
apify call practical_ai_lab_jp/pal-website-migration-readiness-operations --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,practical_ai_lab_jp/pal-website-migration-readiness-operations"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/zYCZNW5aYSdrpxxbD/builds/rpg4U6ZxqAo02ViOV/openapi.json
