Foundation is correct.
Here is the complete and comprehensive list of restrictions on secession:
- You must be Duke.
- Your Duchy must contain at least one city.
- Your Duchy cannot contain all the cities in the realm.
- Your Duchy cannot contain the realm's capital.
- You must be in the city (within your Duchy) that you wish to become the new capital of your realm.
- This city must not have high independence/low control.
- You must have been in both your duchy and realm for at least 2 weeks.
- You must have at least 6 hours available.
- You cannot already be the ruler of your realm.
- You cannot be in an NPC realm (pretty much moot nowadays, save for bugs).
- You cannot have a family member who is already a ruler on the continent.
Can you make a second list for switching allegiance? I think we'd all like to see the exact differences.