Merge "Write file on boot when migration flag is enabled." into main