Clash for Windows migration guide: move subscriptions, rules, and overrides after discontinuation
For users still on an older client, this guide explains how to export subscriptions and custom rules, move to a maintained mihomo-core client, and verify system proxy and DNS behavior after migration.
1. Back up subscriptions, rules, and runtime settings
This process applies when moving from Clash for Windows (CFW) on Windows to a desktop client powered by mihomo, such as Clash Verge Rev. Don’t overwrite the new client’s working directory with the old one: subscription YAML is core configuration, while client toggles, selected policy-group options, override scripts, and service status are managed separately by each client. Copying the directory directly neither ensures those settings take effect nor makes it easy to trace where a setting came from during troubleshooting.
- Back up the subscription source. In CFW, open
Profilesand note the active profile name and subscription URL. If you can’t find the original URL in the old interface, copy the Clash-format link again from your subscription provider’s account page. Links often contain access tokens, so keep them local; don’t paste them into support tickets, public screenshots, or online format-conversion tools. - Save the YAML and local overrides separately. Using the English interface of CFW 0.20.39 as a reference, open the working directory from
General→Home Directoryand check the configuration copies inside. Save the original subscription file, any locally modified YAML, and any Mixin or Parser configuration you can find as separate files. Keep the old working directory as a backup, not as the new client’s configuration directory. - Record runtime selections. Note the rule mode, system proxy and TUN toggle states, the active listening ports, and the currently selected node in each frequently used policy group on the “Proxies” page. If a local tool has a hard-coded proxy address such as
127.0.0.1:7890, record the tool name and port too; importing the same subscription does not guarantee the same port.
2. Import the original subscription before taking over the Windows system proxy
After installing the new client, first turn off its system proxy and TUN. The following steps use the common Clash Verge Rev interface as an example: open “Subscriptions,” paste the original subscription URL, and click “Import.” Once the download completes, select that profile. For a local YAML file, use the file import option on the same page. Button labels may vary slightly between versions. Switch to “Proxies,” check that nodes and policy groups appear, and select “Rule” mode. Don’t load old overrides yet; this helps separate subscription-format issues from override issues.
- A successful download doesn’t mean the configuration is usable. A complete Clash configuration often includes
proxy-groupsandrules. Nodes may be embedded underproxiesor provided throughproxy-providers. If the response is a login page, error text, or a node list the client can’t recognize, ask the provider which Clash or mihomo configuration URL to use. - Switch over only after the configuration loads. In CFW, turn off
System ProxyandTUN ModeunderGeneralif they were enabled, then exit the old client from the system tray. In the new client’s “Settings,” enable only “System Proxy” for now; leave TUN off. This prevents the two clients from competing over system proxy settings or local listening ports. - Check the port Windows is using. Open Windows 11 “Settings” → “Network & internet” → “Proxy.” If the client uses a manual proxy, check that the address and port under “Manual proxy setup” match the new client. If you use PAC or your settings are managed by an organization, check the corresponding script settings or follow your administrator’s instructions. Don’t overwrite organization-managed settings.
3. Rebuild custom rules and overrides without losing subscription updates
Migrate rules first, then handle client-specific scripts
Compare the old configuration with the newly imported subscription to identify which rules come from the provider and which you added yourself. Prefer the new client’s subscription-level rule editor or override feature. If the version has “Extended Configuration” or “Extended Script” options, first check whether they apply to the current subscription or to all subscriptions. CFW Parser and Mixin are mechanisms specific to the old client; don’t paste them unchanged into mihomo YAML. Migrate the processed rules, policies, or DNS settings, then verify the actual results one by one.
The following rules snippet shows part of the final effective configuration, not a complete configuration. It uses reserved example domains to demonstrate matching syntax. DIRECT is the built-in direct-connection policy, while 默认代理 must be the name of a policy group already defined in the current configuration. When migrating, replace it with the exact group name.
rules:
- DOMAIN,docs.example.com,DIRECT
- DOMAIN-SUFFIX,example.net,默认代理
- MATCH,默认代理
Rules are evaluated in order, and evaluation stops at the first match. Put specific exceptions before broad rules that might match first, keep the subscription’s existing rules, and leave MATCH at the end. Don’t replace the entire original configuration with these three lines, and don’t append new rules after the existing MATCH. If the override feature distinguishes between “prepend,” “append,” and “replace,” inspect the merged result: some merge options replace the entire list instead of inserting a few rules.
Check RULE-SET sources and file paths during migration
RULE-SET,work-rules,DIRECT depends on a definition named work-rules under rule-providers. During migration, check that the rule-set URL, behavior type, and file format all match. If you use a local rule file, don’t copy its relative path from the old directory as-is; move the file to the new client’s core working directory and update the path. After updating, check the logs to confirm the rule set loaded, then test a connection to make sure it matches that rule set rather than the final fallback rule. Finally, refresh the subscription manually and check that your custom rules are still present. This confirms whether the override will continue working across subscription updates.
4. Verify ports, rule matches, and DNS separately
Verify the system proxy first; enable TUN afterward
In PowerShell, you can use the following commands to check local listening ports and an explicit HTTP proxy. Here, 7890 is only an example. Replace it with the HTTP or mixed port currently shown by the new client; don’t use a port that accepts SOCKS only.
Test-NetConnection -ComputerName 127.0.0.1 -Port 7890
curl.exe --proxy http://127.0.0.1:7890 -I https://example.com/
TcpTestSucceeded : True only confirms that a process is listening at that address. It doesn’t mean the rules are correct or confirm that the listening process is the new client. An explicit proxy request can help check whether the port handles HTTP proxy traffic as expected, but it doesn’t verify the Windows system proxy. Also use a browser that follows the system proxy to visit one address expected to connect directly and another expected to use a policy group. In the client’s “Connections” or “Logs” view, check the matched rule, outbound policy, and node. If you need to route apps that don’t follow the system proxy, enable TUN separately and complete any service installation or administrator authorization requested by the client.
When troubleshooting DNS, identify the resolver first
- The system proxy works, but connections fail only after enabling TUN: Turn TUN off first to see whether service recovers, then check the active network adapter, other VPNs, and the TUN
dns-hijacksetting. Don’t change the TUN stack, DNS servers, and rule list at the same time, or it will be hard to identify which change caused the issue. - System commands resolve names, but the browser behaves differently:
Resolve-DnsName example.comprovides one view of the Windows resolution path, but it can’t replace checks for browser secure DNS, proxy-side resolution, or core DNS. Compare the connection record for the same request to see whether the core recognized a domain or an IP address, then determine whether a domain rule could match. - Internal domain names fail with fake-IP enabled: First check whether the domain needs to be resolved by your office network or home router’s DNS, then check whether
nameserver-policysends it to the correct upstream server. If the existing configuration uses exclusions infake-ip-filter, you can add an exception for domains that need real addresses. The exception itself doesn’t select an upstream DNS server. Getting an address allocated by fake-IP mode doesn’t, by itself, mean resolution failed.
5. Refresh the subscription, restart, verify, and roll back if needed
A successful migration means more than being able to open a web page. Manually refresh the subscription, restart the new client, and check four things: the expected subscription is active, frequently used policy groups have the expected nodes selected, custom rules still match in the right order, and the system proxy or TUN toggle behaves as expected after restart. If the client launches at startup, make sure the old client doesn’t start with Windows too. If command-line tools have their own HTTP_PROXY or HTTPS_PROXY settings, check that they don’t point to a disabled port.
If you need to restore connectivity immediately, turn off TUN and the system proxy in the new client and exit it. Check that Windows has no leftover proxy settings pointing to a port that is no longer listening, then restore the pre-migration working environment from your backup. Treat rollback as a temporary recovery measure. On your next attempt, start with the verified original subscription, restore one category of rules or settings at a time, and repeat the same tests at each step.