Manual:ImportSites.php/en

Details
importSites.php is a maintenance script that imports site definitions from an XML file into the sites table.

Common error
This error occurs when the file does not exist or the user running the script does not have permission to read the file.
 * Failed to open $file for writing.

If the file does exist, check the file permissions. If you are a root user, you can run the script with sudo.