I'd definately end up writting that as a script.
I like the idea of putting all the phone numbers into a new table entirely, but if there will be issues with performance or implementation issues to doing that then, for sure, leave the fields as phone1, phone2 etc.
Either solution would look something like this..depending on how you access the DB and if you need to eek out all the performance possible.
I'd probably end up with something like:
$query = "SELECT id, phone FROM users";
$result = $db->query($query);
while ($row = $result->fetch_assoc()) {
$phones = array();
$phones = explode('/', $row['phone']);
$i = 1;
foreach($phones as $p) {
if (strlen($p) >= 7) {
$row['phone'.$i] = $p;
$i++;
}
}
$upquery = "UPDATE users SET phone1='{$row['phone1}', phone2='{$row['phone2}', ...
WHERE id={$row['id'];";
$result = $db->query($query);
}
I have the string length test in place to prevent odd fragments from being saved as phone numbers. You could also use a little regex magic to pretty up each phone number before saving it.
Ways to make it faster would be to run multiple updates in the same query. If the script times out on you then you could restrict the number of user rows that are affected by each execution and run it multiple times.